Combobox on gtk+ 2

J

Joona I Palaste

giorgix said:
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

GTK+2 is not a standard C feature, so therefore it's off-topic here.
Please ask in comp.unix.programmer or a suitable GTK newsgroup.
Thanks.
 
M

Mike Wahler

giorgix said:
Il 26 Feb 2004 21:01:51 GMT


There aren't newsgroup on gtk,

None on my news server either. Bummer.
and i'm working on windows, so my
question would be off topic on comp.unix.programmer.

Right. It would also be off-topic in a Windows group.
You're asking about GTK.
In my opinion, this is the right group.

Your opinion doesn't supercede the existing definition
of this newsgroup:
http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html
If you know some newsgroup about gtk, let me know it.

I see at www.gtk.org that they do have a mailing list.
Have you tried that?

-Mike
 
G

giorgix

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
 
G

giorgix

Il 26 Feb 2004 21:01:51 GMT
Joona I Palaste said:
GTK+2 is not a standard C feature, so therefore it's off-topic here.
Please ask in comp.unix.programmer or a suitable GTK newsgroup.

There aren't newsgroup on gtk, and i'm working on windows, so my
question would be off topic on comp.unix.programmer.
In my opinion, this is the right group.
If you know some newsgroup about gtk, let me know it.
Cheers, Gio
 
R

Rob Thorpe

giorgix said:
Il 26 Feb 2004 21:01:51 GMT


There aren't newsgroup on gtk, and i'm working on windows, so my
question would be off topic on comp.unix.programmer.
In my opinion, this is the right group.
If you know some newsgroup about gtk, let me know it.
Cheers, Gio

There is a mailing list about gtk at www.gtk.org :
(e-mail address removed). That is were you should ask the
question.
 
G

giorgix

Il Thu, 26 Feb 2004 21:22:42 GMT
Mike Wahler said:
Your opinion doesn't supercede the existing definition
of this newsgroup:
http://www.angelfire.com/ms3/bchambless0/welcome_to_clc.html

I know, this is a high traffic group, so any OT problem annoys much,
but I searched for the solution a lot, and i found the majority posts
about gtk on this group.
The problem is that my question would be OT in *any* group.
I see at www.gtk.org that they do have a mailing list.
Have you tried that?

This is a good advice, i'm going to try...

Cheers, Gio
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,810
Latest member
Kassie0918

Latest Threads

Top