Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to add a text Combo Box into my app. I've created in and populated the list but when I I try to print out the active text I get an error.

Here's the part of the code in question:

    def on_netif_changed(self, widget):
    netif = widget.gtk_combo_box_text_get_active_text()
    print netif

And the error I get:

Traceback (most recent call last):
File "/home/boywithaxe/Developer/Quickly/broadcast/broadcast/", line 44, in on_netif_changed
netif = widget.gtk_combo_box_text_get_active_text()
AttributeError: 'ComboBoxText' object has no attribute 'gtk_combo_box_text_get_active_text'

I'm a bit at a loss here, I've no problem betting text from text boxes, but this seems a completely different issue. I tried RTFMing but came up short. I would appreciate any suggestions.

share|improve this question
up vote 2 down vote accepted

The method name is "get_active_text" not "gtk_widget_get_active_text" (that is the name of the C function), i.e. you should do:

def on_netif_changed(self, widget):
    netif = widget.get_active_text()
    print netif
share|improve this answer
Thank you, that did it! – boywithaxe Jun 21 '12 at 22:16

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.