By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,675 Members | 2,255 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,675 IT Pros & Developers. It's quick & easy.

Using pygtk and glade2

P: n/a
I am having a problem with combo boxes. If I am using an XML glade2
file for my gui definition, what is the command I need to use to
access a given combo box and determine the currently selected item?

jonathon
Jul 18 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
P
j_mckitrick wrote:
I am having a problem with combo boxes. If I am using an XML glade2
file for my gui definition, what is the command I need to use to
access a given combo box and determine the currently selected item?

jonathon


That's easy: text = combo.entry.get_text()
More info here:
http://www.async.com.br/faq/pygtk/in...=faq14.008.htp
Getting the selected item in an option menu is much more difficult:
http://www.async.com.br/faq/pygtk/in...=faq16.004.htp

Examples are always good:
http://www.pixelbeat.org/talks/pygtk/

Pádraig.
Jul 18 '05 #2

P: n/a
> That's easy: text = combo.entry.get_text()

But when I use

self.wTree.get_widget('Combo').entry.get_text()

it tells me

gtk.Bin does not have attribute 'entry'
Jul 18 '05 #3

P: n/a
P
j_mckitrick wrote:
That's easy: text = combo.entry.get_text()

But when I use

self.wTree.get_widget('Combo').entry.get_text()

it tells me

gtk.Bin does not have attribute 'entry'


Hang on, gtk.Bin isn't even in the combo hierarchy?
http://www.pygtk.org/pygtk2reference...-gtkcombo.html
Are you sure you've got the correct widget?

Pádraig.
Jul 18 '05 #4

P: n/a
> Hang on, gtk.Bin isn't even in the combo hierarchy?
http://www.pygtk.org/pygtk2reference...-gtkcombo.html
Are you sure you've got the correct widget?

Pádraig.


I clicked on it in Glade2, and the property window said 'combobox1'.
Then I added the signal and built the app. This is the same thing I
did with 'comboentrybox'.

jonathon
Jul 18 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.