[Glade-users] reading from xml documents to combo boxes




On Thu, 2008-03-13 at 11:41 -0700, Atmadarshini devi dasi wrote:

Is combo box the best choice or is there another widget that is
better and easier to use? 


Unless you operate really tiny address book which will fit on average
screen (and then what's the point writing a program for it?) it is not
really suitable widget. You should use treeview for that. I would not
say it is easier, but it worth it.

        > I have pasted the code where i am trying to read into the
        combo box below.
        > Please tell me where I am going wrong. Thank you.
        >
        > GtkWidget *vlname_entry_widget =
        > lookup_widget(GTK_WIDGET(view_address_window),
        "vlname_combo");
        > gtk_combo_box_set_active
        (GTK_COMBO_BOX(vlname_entry_widget),
        > address->lastname);

That is totally wrong function to "read into the combo box". That one
just selects an item which is already there. To fill up the combo box
you either use gtk_combo_box_append_text or manipulate underlying model,
depending on what type of combobox it is. But again, consider treeview.





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