[Glade-users] problem on GTK_combo_box_entry.



Hello there,
   I'm a rookie to Glade. I got some problem when I tried to deal with
combo box entry.
   I tried to lookup the widget like this line:

GtkWidget *Sex= lookup_widget( GTK_WIDGET(button), "comboboxSex" );

  It seems nothing went wrong in both compiling and excution.
But when I tried to refer to the text by this line:

current.sex= gtk_entry_get_text ( GTK_ENTRY( GTK_COMBO(Sex)->entry ) );

// according the GTK 2.0 tutorial at
http://www.gtk.org/tutorial/sec-combobox.html

It went wrong and showing "GLib-GObject-WARNING **: invalid cast from
`GtkComboBoxEntry' to `GtkCombo'" in excution.

I'm confused about if the widget obtained by lookup_widget can be used
directly as normal status. Please correct me if there is any
conceptional error. If not, how can I obtain the text of the Sex
widget?

Thanks for any possible replies. :P




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