1.

How Do I Check If A Widget Is Currently Sensitive?

Answer»

In pygtk, you GET properties by calling the get_property() method:

  if widget.get_property('sensitive') == 0:
PRINT "I'm insensitive!"

Note: In ancient versions of pygtk (0.6.x) you could ACCESS them using a dictionary interface, this was removed in the 2.x series.

More RECENTLY (since PyGTK 2.8) the following method can be used:

if not widget.props.sensitive:

print "I'm insensitive!"

In pygtk, you get properties by calling the get_property() method:

  if widget.get_property('sensitive') == 0:
print "I'm insensitive!"

Note: In ancient versions of pygtk (0.6.x) you could access them using a dictionary interface, this was removed in the 2.x series.

More recently (since PyGTK 2.8) the following method can be used:

if not widget.props.sensitive:

print "I'm insensitive!"



Discussion

No Comment Found