diff options
author | Jack Jansen <jack.jansen@cwi.nl> | 1996-04-11 15:39:01 (GMT) |
---|---|---|
committer | Jack Jansen <jack.jansen@cwi.nl> | 1996-04-11 15:39:01 (GMT) |
commit | cef2c597fec211a708954a6d934d5ae708b1a61d (patch) | |
tree | 48d2262941f4b466f097df4dd70727b616f7603e /Mac/Lib/FrameWork.py | |
parent | 5c6e3738cd2179600c24bc1241eb5daa584ccc47 (diff) | |
download | cpython-cef2c597fec211a708954a6d934d5ae708b1a61d.zip cpython-cef2c597fec211a708954a6d934d5ae708b1a61d.tar.gz cpython-cef2c597fec211a708954a6d934d5ae708b1a61d.tar.bz2 |
Added enable(onoff) method to menus and menu items
Diffstat (limited to 'Mac/Lib/FrameWork.py')
-rw-r--r-- | Mac/Lib/FrameWork.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Mac/Lib/FrameWork.py b/Mac/Lib/FrameWork.py index 89f1e02..36e951a 100644 --- a/Mac/Lib/FrameWork.py +++ b/Mac/Lib/FrameWork.py @@ -432,6 +432,11 @@ class Menu: if callback: callback(id, item, window, event) + def enable(self, onoff): + if onoff: + self.menu.EnableItem(0) + else: + self.menu.DisableItem(0) class MenuItem: def __init__(self, menu, title, shortcut=None, callback=None, kind=None): @@ -440,6 +445,12 @@ class MenuItem: def check(self, onoff): self.menu.menu.CheckItem(self.item, onoff) + + def enable(self, onoff): + if onoff: + self.menu.menu.EnableItem(self.item) + else: + self.menu.menu.DisableItem(self.item) class RadioItem(MenuItem): |