|
|
| Author |
Message |
|
|
atma64 Familiar Face
Joined: 01 Apr 2008 Posts: 6
|
Posted: Tue Apr 01, 2008 12:18 pm Post subject: problems with treeview and glade |
|
|
Hi there
I am trying to create a network stored address book using Glade and Gtk. now I am trying to for instance view data from an xml file into a treeview structure.
Now this address book that i am creating, i am creating on an already existing project therefore some of the include files etc. are in common with the big project.
Now what i did is that using glade, i created a window called view_address_window and in there I have a treeview. Then I started coding the treeview but I am not able to even see the headings of the treeview. What I am not sure about is how to then find that treeview structure? I tried using the xml commands such as
GladeXML *xml = NULL;
GNode *contact = NULL;
gchar *parsed[7] = { NULL, NULL, NULL, NULL, NULL, NULL, NULL };
xml = glade_xml_new ("imsUA.glade", NULL, NULL);
view_address_window = glade_xml_get_widget (xml, "view_address_window");
treeview = glade_xml_get_widget (xml, "treeview");
setup_tree_view (treeview);
glade_xml_signal_autoconnect (xml);
but i get an error that they cant recognise what this GladeXML is.
Basically how do i go about solving this problem and seeing the treeview being recognised?
thanks |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 376 Location: State College, Pennsylvania
|
Posted: Sun Apr 06, 2008 3:02 pm Post subject: |
|
|
| Do you have libglade2-dev installed? These are the development libraries and headers for Glade. |
|
| Back to top |
|
 |
atma64 Familiar Face
Joined: 01 Apr 2008 Posts: 6
|
Posted: Mon Apr 07, 2008 12:14 pm Post subject: |
|
|
hi
Yes I have the libglade2-dev files installed. how do i link them to my project? |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 376 Location: State College, Pennsylvania
|
Posted: Mon Apr 07, 2008 1:06 pm Post subject: |
|
|
| If you are just compiling the files on the command line, use `pkg-config --cflags --libs libglade-2.0`. (Those are back ticks on the same key as ~). Also, you have to include -export-dynamic if you want to autoconnect any signals. |
|
| Back to top |
|
 |
atma64 Familiar Face
Joined: 01 Apr 2008 Posts: 6
|
Posted: Tue Apr 08, 2008 12:47 pm Post subject: |
|
|
thanks i managed to solve that problem...
just as a matter of interest, what do u mean by autoconnect signals? what does that help with and in which scenarios is it used? |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 376 Location: State College, Pennsylvania
|
Posted: Tue Apr 08, 2008 1:12 pm Post subject: |
|
|
| When you create signals in Glade, you have to connect them in your code. You can call glade_xml_connect_signal() on each, or you can just call glade_xml_autoconnect(). The latter function parses through your application's binary, searching for the functions. You have to use -export-dynamic so that libglade (or GtkBuilder in GTK+ 2.12) can find those functions. |
|
| Back to top |
|
 |
atma64 Familiar Face
Joined: 01 Apr 2008 Posts: 6
|
Posted: Thu Apr 10, 2008 11:49 am Post subject: libglade-WARNING **: could not find signal handler |
|
|
Hi
Whats the exact correct code to use -export-dynamic in the makefile?
What I am trying to do now is to use some toolbuttons but i get errors such as
(uctimsclient:22654): libglade-WARNING **: could not find signal handler 'on_edit_clicked'.
(uctimsclient:22654): libglade-WARNING **: could not find signal handler 'on_clear_clicked'.
(uctimsclient:22654): libglade-WARNING **: could not find signal handler 'on_new_clicked'.
(uctimsclient:22654): libglade-WARNING **: could not find signal handler 'on_add_clicked'.
(uctimsclient:22654): libglade-WARNING **: could not find signal handler 'on_remove1_clicked'.
(uctimsclient:22654): libglade-WARNING **: could not find signal handler 'on_view_address_window_delete_event'.
(uctimsclient:22654): libglade-WARNING **: could not find signal handler 'on_open_clicked'.
How can i solve these errors?
I have attached my makefile below
| Code: (Plaintext) | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
#Makefile for UCT IMS Client version 1.0
#
#Compiler: gcc 4.0.3
CC = gcc
LIBS = -L/usr/local/lib -leXosip2 -lxml2 -lcurl -lgstinterfaces-0.10
INCLUDES = -I/usr/include/libxml2 -I/usr/include/libglade-2.0
GTK_LIB_FLAGS = `pkg-config --cflags --libs gtk+-2.0`
GTK_LIB_FLAGS = `pkg-config --cflags --libs libglade-2.0`
GTK_INC_FLAGS = `pkg-config --cflags gtk+-2.0 gstreamer-0.10`
ODIR=obj
_OBJS = callbacks.o common_exosip_event_handler.o common_interface_event_handler.o DigestAKAv1MD5.o ims_exosip_event_handler.o \
ims_interface_event_handler.o interface.o imsUA.o media.o preferences.o addressbook.o presence.o \
sdp_methods.o sound_conv.o support.o useful_methods.o watchers.o xcap.o gstreamer.o
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
SRC_DIR=src
SRCS = imsUA.c callbacks.c common_exosip_event_handler.c common_interface_event_handler.c DigestAKAv1MD5.c ims_exosip_event_handler.c \
ims_interface_event_handler.c interface.c media.c preferences.c addressbook.c presence.c \
sdp_methods.c sound_conv.c support.c useful_methods.c watchers.c xcap.c gstreamer.c
PROG = uctimsclient
all: $(PROG)
$(PROG): $(OBJS)
$(CC) -o $@ $(GTK_LIB_FLAGS) \
$(LIBS) $(OBJS)
$(ODIR)/%.o: $(SRC_DIR)/%.c
$(CC) $(INCLUDES) $(GTK_INC_FLAGS) -o $@ -c $<
depend: $(SRCS)
makedepend $(SRCS)
clean:
rm -f $(PROG) $(ODIR)/*.o *~ $(SRC_DIR)/*~
# DO NOT DELETE THIS LINE -- | |
|
| Back to top |
|
 |
openldev Never Seen the Sunlight
Joined: 21 Sep 2005 Posts: 376 Location: State College, Pennsylvania
|
Posted: Thu Apr 10, 2008 5:40 pm Post subject: |
|
|
Just create a flag such as:
| Code: (Plaintext) | 1
| FLAGS = -export-dynamic |
and then add $(FLAGS) to your compile line like:
| Code: (Plaintext) | 1 2 3 4 5 6
| $(PROG): $(OBJS)
$(CC) -o $@ $(FLAGS) $(GTK_LIB_FLAGS) \
$(LIBS) $(OBJS)
$(ODIR)/%.o: $(SRC_DIR)/%.c
$(CC) $(FLAGS) $(INCLUDES) $(GTK_INC_FLAGS) -o $@ -c $< | |
|
| Back to top |
|
 |
|