[Glade-users] gtkbuilder and textview - I'm confused



Hi guys,

I'm using Glade 3.6.7 on Ubuntu linux and writing a program in c language.

This is likely going to be a dumb question, as I'm new to Glade. Regardless...

I've created a simplified example to illustrate my problem.

I have a UI which consists of window1 which contains a single textview (textview1). In Glade, I added the 
buffer to be textbuffer1. I saved the file as gtkbuilder format.

Running my makefile results in the following output:

gcc -Wall -g `pkg-config --cflags gtk+-2.0 gmodule-2.0` -c main.c
main.c: In function ?main?:
main.c:31: warning: ?textview1? is used uninitialized in this function
gcc -Wall -g `pkg-config --libs   gtk+-2.0 gmodule-2.0` main.o -o textview

I haven't figured out how to fix that warning but I suspect it is not something to be ignored.

Running the compiled program with./textview results in a seg fault.

gdb has this to say:

(gdb) file textview
Reading symbols from /home/textview/textview...done.
(gdb) r
Starting program: /home/textview/textview 
[Thread debugging using libthread_db enabled]

Program received signal SIGSEGV, Segmentation fault.
0x008531b0 in g_type_check_instance_cast () from /usr/lib/libgobject-2.0.so.0
(gdb) bt
#0  0x008531b0 in g_type_check_instance_cast () from /usr/lib/libgobject-2.0.so.0
#1  0x08048b92 in main (argc=1, argv=0xbffff4b4) at main.c:31

Can anyone clear up my confusion?

The program (textview.c), Makefile, and gtkbuilder file are attached.

Thanks,
Dave
-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.c
Type: text/x-csrc
Size: 869 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20110503/a7ac2161/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: application/octet-stream
Size: 429 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20110503/a7ac2161/attachment.obj 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: textview.glade
Type: application/x-glade
Size: 640 bytes
Desc: not available
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20110503/a7ac2161/attachment-0001.bin 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]