[Glade-users] help regarding the combobox append functionality at runtime



hello,

        I am making my own function as shown below in the callbacks.c but
when i am using the g_list_append() function i am getting the errors
and my system shows the dialog box of fatal error with the
segmentation fault....Initially i was using this thind in the for loop
but even when i tried keeping it outside the loop the same error
appears please have a look at the code.....And mail me the solution if
anyone knows about it.....

int myfunc(char *name)
{        int i=0;   
        GtkWidget *seccmbentry;
        GList *items,*seccmb_items;
        ini = iniparser_load(ini_name); //one of thelibrary function that i am using
        if (ini==NULL)
        {
                fprintf(stderr, "cannot parse file [%s]", ini_name);
                return -1 ;
        }
        
        section=iniparser_getnsec(ini); //library function
        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 me error over here
        }
        
        //gtk_entry_set_text (GTK_ENTRY (seccmbentry), seccmb_items);
                
                         //items=gtk_combo_box_append_text(GTK_COMBO_BOX(seccmb),"hghfhg");
        //gtk_combo_set_popdown_strings (GTK_COMBO (seccmb), items);
    
        iniparser_freedict(ini); //my library function
        return 0;
}      


Please help me as soon as possible .......
bye
Poonam




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