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

L

Lee Harr

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top