473,385 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Combobox on gtk+ 2

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
Nov 14 '05 #1
5 2967
giorgix <gi*****@myrealbox.net> scribbled the following:
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.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-- http://www.helsinki.fi/~palaste --------------------- rules! --------/
"C++ looks like line noise."
- Fred L. Baube III
Nov 14 '05 #2
Il 26 Feb 2004 21:01:51 GMT
Joona I Palaste <pa*****@cc.helsinki.fi> ha scritto:
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
Nov 14 '05 #3
"giorgix" <gi*****@myrealbox.net> wrote in message
news:20040226220829.2069589b.gi*****@myrealbox.net ...
Il 26 Feb 2004 21:01:51 GMT
Joona I Palaste <pa*****@cc.helsinki.fi> ha scritto:
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,


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/bchambl...me_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
Nov 14 '05 #4
giorgix <gi*****@myrealbox.net> wrote in message news:<20040226220829.2069589b.gi*****@myrealbox.ne t>...
Il 26 Feb 2004 21:01:51 GMT
Joona I Palaste <pa*****@cc.helsinki.fi> ha scritto:
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


There is a mailing list about gtk at www.gtk.org :
gt****************@gnome.org. That is were you should ask the
question.
Nov 14 '05 #5
Il Thu, 26 Feb 2004 21:22:42 GMT
"Mike Wahler" <mk******@mkwahler.net> ha scritto:
In my opinion, this is the right group.


Your opinion doesn't supercede the existing definition
of this newsgroup:
http://www.angelfire.com/ms3/bchambl...me_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.
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?


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

Cheers, Gio
Nov 14 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wil Koenen | last post by:
Hi, When importing (parts of) gtk, here's what I get: >>> import gobject Traceback (most recent call last): File "<pyshell#13>", line 1, in ? import gobject ImportError: DLL load failed:...
2
by: Dennis | last post by:
The setup: Windows XP Pro Python 2.3 GTK+ 2.2.1.2 and pyGTK 1.99.17 for Python 2.3 from http://www.pcpm.ucl.ac.be/~gustin/win32_ports/ I've downloaded and installed per the instructions the...
4
by: j_mckitrick | last post by:
Hi all. Here is a tiny container for one of each combo box, along with the glade file. Just 2 widgets, so hopefully not too large. How the heck do I get the selection from the ComboBox, as...
1
by: kristian.hermansen | last post by:
keherman@ibmlnx20:/tmp$ cat helloworld.py #!/usr/bin/env python import pygtk pygtk.require('2.0')
6
by: johnmmcparland | last post by:
Hi all, I am doing some C / C++ programming in cygwin and I notice when I add something to my path then try to compile, the gcc / g++ compiler cannot find some files, even though they are in the...
6
by: kdikert | last post by:
I have a worker thread, and when the worker is done I want it to show a popup dialog. The sample application below demonstrates this. There are two buttons: a "Show dialog" button which immediately...
8
kaarthikeyapreyan
by: kaarthikeyapreyan | last post by:
The gtk version which tried to install is 2.12.9 The Glib version is 2.16.3 /bin/sh ../libtool --mode=link gcc -g -O2 -Wall -o gtk-query-immodules-2.0 queryimmodules.o libgtk-x11-2.0.la...
1
kaarthikeyapreyan
by: kaarthikeyapreyan | last post by:
This time am getting a new error gcc -DHAVE_CONFIG_H -I. -I. -I.. -DG_LOG_DOMAIN=\"Gtk\" -DGTK_LIBDIR=\"/home/numenta/gtk+-2.9.4/gtkconf/lib\"...
0
by: Joel Hedlund | last post by:
Hi! I'm developing a pygtk application where I need to show images zoomed in so that the user can see individual pixels. gtk.gdk.Pixbuf.scale() seemed ideal for this, but if I set offset_x and...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.