diff options
author | Guido van Rossum <guido@python.org> | 1992-12-14 14:52:49 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 1992-12-14 14:52:49 (GMT) |
commit | 6c5c52583a58e2dbd5000ac7bf59162204ed8eec (patch) | |
tree | c853805870c723afe21fb735f1cb7afa791607f1 | |
parent | 93a35f40a9bc73fa359d033d8232aef7ec8f8799 (diff) | |
download | cpython-6c5c52583a58e2dbd5000ac7bf59162204ed8eec.zip cpython-6c5c52583a58e2dbd5000ac7bf59162204ed8eec.tar.gz cpython-6c5c52583a58e2dbd5000ac7bf59162204ed8eec.tar.bz2 |
Explicitly close menus. Make '0' mean the last menu item.
-rwxr-xr-x | Demo/stdwin/ibrowse/ibrowse.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Demo/stdwin/ibrowse/ibrowse.py b/Demo/stdwin/ibrowse/ibrowse.py index 323ff5a..41574ad 100755 --- a/Demo/stdwin/ibrowse/ibrowse.py +++ b/Demo/stdwin/ibrowse/ibrowse.py @@ -111,6 +111,8 @@ def makewindow(file, ref): win.last = [] win.pat = '' win.dispatch = idispatch + win.nodemenu = None + win.footmenu = None windows.append(win) imove(win, ref) @@ -213,6 +215,7 @@ def idispatch(event): return if detail in '0123456789': i = eval(detail) - 1 + if i < 0: i = len(win.menu) + i if 0 <= i < len(win.menu): topic, ref = win.menu[i] imove(win, ref) @@ -500,6 +503,8 @@ def imove(win, ref): (left, top), (right, bottom) = win.textobj.getrect() win.setdocsize(0, bottom) # + if win.footmenu: win.footmenu.close() + if win.nodemenu: win.nodemenu.close() win.footmenu = None win.nodemenu = None # |