Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
C Programming
Combobox on gtk+ 2
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="giorgix, post: 1703628"] Hi folks! I'm working with gtk+ 2 on windows. I created with Glade my interface and now i add my own code. I have difficult to retrieve text from a combo box. This is the code (from callbacks.c file, generated by Glade): 1 void 2 on_bt_ok_clicked (GtkButton *button, 3 gpointer user_data) 4 { 5 GtkWidget *entry1 = lookup_widget(GTK_WIDGET(button), "committente"); 6 gchar *committente = gtk_entry_get_text(GTK_ENTRY(entry1)); [...] 7 GtkWidget *entry4 = lookup_widget(GTK_WIDGET(button), "comune_combo"); 8 gchar *comune_combo = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO (entry4)->entry)); [...] 9 } This code is a callback for a button's pression. lookup_widget() is a function provided by Glade, that returns the pointer of a widget. On lines 5-6 i retrieve the input from a text field and it works. On lines 7-8 i'm trying to do the same thing with a combo box. I can compile and run the application, but when I click the button I get the error: "Gtk-CRIRTICAL **: file gtkentry.c: line 3437 <gtk_entry_get_text>: assertion 'GTK_IS_ENTRY <entry>' failed". I found the code on the official gtk+2 tutorial, so i guess it's correct, so why doesn't work? Cheers, Gio [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
C Programming
Combobox on gtk+ 2
Top