2

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/BroadcastWindow.py", 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.

1 Answer 1

2

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
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .