PyGUI: 'gtk.Button' object has no attribute 'get_sensitive'

Lee Harr missive at frontiernet.net
Sat Sep 25 19:05:44 EDT 2004


I wanted to modify the program Tests/04-button.py like so:

def simulate_hello():
    btn1.activate()

becomes...

def simulate_hello():
    if btn2.enabled:
        btn2.activate()
    else:
        btn1.activate()


but when I click on btn3 I get this:

[...]
  File "04a-button.py", line 12, in simulate_hello
    if btn2.enabled:
  File "/usr/local/lib/python2.3/site-packages/GUI/Generic/Properties.py", line 30, in <lambda>
    lambda self: getattr(self, getter_name)(),
  File "/usr/local/lib/python2.3/site-packages/GUI/Gtk/Controls.py", line 34, in get_enabled
    return self._gtk_outer_widget.get_sensitive()
AttributeError: 'gtk.Button' object has no attribute 'get_sensitive'


I also tried btn2.get_enabled() but that gives the same error.

Any hints on how to find out if the button is enabled?




More information about the Python-list mailing list