Development Team/Almanac/sugar.activity.activity: Difference between revisions
No edit summary |
|||
| Line 51: | Line 51: | ||
#hide the undo button | #hide the undo button | ||
self._edit_toolbar.undo.props.visible=False | self._edit_toolbar.undo.props.visible=False | ||
=== How do I disable and enable a button on the edit toolbar? === | |||
Some buttons, such as copy, may need to be disabled under certain circumstances (eg. there is nothing to copy). This can be done by changing the sensitivity of the widget, as the following code shows: | |||
#disable the use of the copy button for now. | |||
self._edit_toolbar.copy.set_sensitive(False) | |||