GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Aug 21, 2014 8:01 pm

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: problems with treeview and glade
PostPosted: Tue Apr 01, 2008 12:18 pm 
Offline
Familiar Face

Joined: Tue Apr 01, 2008 11:56 am
Posts: 6
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


Top
 Profile  
 
 Post subject:
PostPosted: Sun Apr 06, 2008 3:02 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
Do you have libglade2-dev installed? These are the development libraries and headers for Glade.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 12:14 pm 
Offline
Familiar Face

Joined: Tue Apr 01, 2008 11:56 am
Posts: 6
hi

Yes I have the libglade2-dev files installed. how do i link them to my project?


Top
 Profile  
 
 Post subject:
PostPosted: Mon Apr 07, 2008 1:06 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
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.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 12:47 pm 
Offline
Familiar Face

Joined: Tue Apr 01, 2008 11:56 am
Posts: 6
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?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 08, 2008 1:12 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
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.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject: libglade-WARNING **: could not find signal handler
PostPosted: Thu Apr 10, 2008 11:49 am 
Offline
Familiar Face

Joined: Tue Apr 01, 2008 11:56 am
Posts: 6
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=]
#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 --[/code]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Apr 10, 2008 5:40 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
Just create a flag such as:

Code:
FLAGS = -export-dynamic


and then add $(FLAGS) to your compile line like:

Code:
$(PROG): $(OBJS)
    $(CC) -o $@ $(FLAGS) $(GTK_LIB_FLAGS) \
    $(LIBS) $(OBJS)

$(ODIR)/%.o: $(SRC_DIR)/%.c
    $(CC) $(FLAGS) $(INCLUDES) $(GTK_INC_FLAGS) -o $@ -c $<

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group