GtkEntry struct trouble




        Hi, I have a problem with a struct of GtkWidget *'s array,

        In order to make several functions to analize the data
        entered by a user in a window with several entries, I
        came up with a struct like this:

        typedef struct _ABentries ABentries;
        struct _ABentries {
           GtkWidget *arrentries[8];
           int        gotentries[8];   /* Just a flags to see if */
                                       /* there's some text entered *
                                       /*  in the entries */
        };

        later in the program, I pass a g_malloc'ed ABentry * to
        a function that set all the entries in a window with a
        couple of buttons ("OK" & "Cancel") and other vanal stuffs.
        Also this function set the proper calbacks when the entries
        are "activated"... Here is where the problem arises:

        When the callback receives the ABentries * it causes a
        segmentation fault, so my question is:

        Does the GtkWidget * returned by gtk_entry_new() is lost
        when the function is invoked ends?


        I am not so sure I explained the whole point so clear so,
        the code is attached (I hope it will say more than I do).

        Thanks in advance for any corrections.

        Regards.

Attachment: code.c.gz
Description: Binary data

Attachment: pgpkaXiPdx04F.pgp
Description: PGP signature



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