g_type_check_instance_cast segfault with entries



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi, 
I have some problems with a strange segfault ,
Hi wrote a code wich do something like that:
for( i = 0 ; i < key_num ; i++){

    char tmp[256];

    snprintf(tmp,256, "keyword number %d :",i+1);

    label = gtk_label_new (tmp);
    gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, TRUE, 0);

    entry[i] = gtk_entry_new ();
    gtk_entry_set_max_length (GTK_ENTRY (entry[i]), 300);

    tmp_pos[i] = GTK_ENTRY (entry[i])->text_length;
    gtk_editable_select_region (GTK_EDITABLE (entry[i]), 0, GTK_ENTRY 
(entry[i])->text_length);
    gtk_box_pack_start (GTK_BOX (vbox), entry[i], TRUE, TRUE, 0);
            }

    entry[i] = NULL;

My problem is that , when I try with my hadler to take the entry-text :
char tmp[2056],*temp;

for(i = 0 ; list[i] != NULL; i++){


   temp = gtk_editable_get_chars (GTK_EDITABLE (list[i]),0,-1);

   snprintf(tmp,2056,"  list[%d]=\"%s\";\n",i , temp);

It segfaults with this message:

Program received signal SIGSEGV, Segmentation fault.
0x4041ecdc in g_type_check_instance_cast () from /usr/lib/libgobject-2.0.so.0
(gdb)
(gdb) bt
#0  0x4041ecdc in g_type_check_instance_cast () 
from /usr/lib/libgobject-2.0.so.0
#1  0x0804c227 in list_comp () at ged.c:104 --> the fuction wich take entries


Some important notes:
1)The entries are insered into a paned-scrolled window
2)entries are passed to the fuction as args of the g_signal call

Any advice? or  any mistake in my code?

ps: Sorry my poor english

TIA

- -- 
You can download my public key from :
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0xAF03412D


Per me si va tra la perduta gente

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iQCVAwUBQUgxQMRZnwcjHpecAQIhVAQAp4pR10YMRAEh5C4C4I+6ip7iUeq03wbD
zmBXvQOwCW5cRJf4Ma1ANhMjU92tZaud4nIigJGSxGkuY/bKsn0Bi+ACDzzTjwV6
kiNST+Y4VgQ8Ni8KgwJsL7cAy5lTSax1UQ6lJrKgJYLwsazshwLDHViOOS+MV7Jt
pPhL9EHYym8=
=edBN
-----END PGP SIGNATURE-----



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