FAQ Index - Search - Recent Changes - Everything - Add entry

<< Previous Entry | FAQ Entry 14.8 | Next Entry >>

14.8. How do I get the currently selected text in a GtkCombo?

The GtkCombo inherits from a GtkHBox, and contains both a GtkEntry and a GtkButton, but it offers a convenience attribute that gets the entry back for you. Since the current selection is held in the GtkCombo's GtkEntry, use something like:

 text = combo.child.get_text()

PyGTK FAQ Wizard | PyGTK Homepage | Feedback to faq at pygtk.org