help regarding the combobox



hello,

I am using the combobox in the heirarchy as shown
-Main window
        -secframe
                -secfixed
                        -seccmb
Now i am trying to add some data to the the combo box usingthe g_list_append()
function in my own callback defined in the callback.c ..But it gives
me the segmentationfault
My function goes like this....

int parse_ini_file(char * ini_name)
{        
        int i=0;   
        GtkWidget *seccmbentry;
        GList *items=NULL;
        GList *seccmb_items=NULL;
        
        ini = iniparser_load(ini_name); //library function that i am using
        if (ini==NULL)
        {
                fprintf(stderr, "cannot parse file [%s]", ini_name);
                return -1 ;
        }
        section=iniparser_getnsec(ini); //library function that will return the count
        printf("the number of sections:%d\n",section);
        seccmbentry = GTK_COMBO (seccmb)->entry;
        for(i=0;i<=section-1;i++)
        {
                seccmb_items=iniparser_getsecname(ini,i); //library function
                printf("Items=%s\n",seccmb_items);
                items=g_list_append(items,seccmb_items); //giving segmentation fault over here
        }
        
        gtk_entry_set_text (GTK_ENTRY (seccmbentry), seccmb_items);
        gtk_combo_set_popdown_strings (GTK_COMBO (seccmb), items);

        iniparser_freedict(ini); //library function
        return 0;
}      

I dont know where i am going wrong...Please look and the code and help
me with it..I even tried using the seccmbentry activate signal by no
luck over there also and i am supposed to fetch the data from this
function and display it in the combobox .....Please help..........

bye



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