summaryrefslogtreecommitdiffstats
path: root/Tools/pynche/PyncheWidget.py
diff options
context:
space:
mode:
authorBarry Warsaw <barry@python.org>1998-10-01 16:46:16 (GMT)
committerBarry Warsaw <barry@python.org>1998-10-01 16:46:16 (GMT)
commit86daeb79092be555f7a7519751031df45a828fba (patch)
tree6406a409ac3fddd17b61bfb799261046952d35f1 /Tools/pynche/PyncheWidget.py
parentf9c6ddc40acc94d80c1d105a4c206003caf38b2b (diff)
downloadcpython-86daeb79092be555f7a7519751031df45a828fba.zip
cpython-86daeb79092be555f7a7519751031df45a828fba.tar.gz
cpython-86daeb79092be555f7a7519751031df45a828fba.tar.bz2
Added View button and popup of text widget
Diffstat (limited to 'Tools/pynche/PyncheWidget.py')
-rw-r--r--Tools/pynche/PyncheWidget.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/Tools/pynche/PyncheWidget.py b/Tools/pynche/PyncheWidget.py
index af422b7..2222c05 100644
--- a/Tools/pynche/PyncheWidget.py
+++ b/Tools/pynche/PyncheWidget.py
@@ -11,7 +11,10 @@ KEEPALIVE_TIMER = 500
class PyncheWidget:
- def __init__(self, version):
+ def __init__(self, version, switchboard):
+ self.__sb = switchboard
+ self.__version = version
+ self.__textwin = None
# create the first and top window
root = self.__root = Tk(className='Pynche')
root.protocol('WM_DELETE_WINDOW', self.__quit)
@@ -38,6 +41,17 @@ class PyncheWidget:
root.bind('<Alt-q>', self.__quit)
root.bind('<Alt-Q>', self.__quit)
#
+ # View menu
+ #
+ viewbtn = Menubutton(menubar, text='View',
+ underline=0)
+ viewbtn.pack(side=LEFT)
+ viewmenu = Menu(viewbtn, tearoff=0)
+ viewbtn['menu'] = viewmenu
+ viewmenu.add_command(label='Text Window...',
+ command=self.__popup_text,
+ underline=0)
+ #
# Help menu
#
helpbtn = Menubutton(menubar, text='Help',
@@ -77,3 +91,10 @@ All rights reserved
For information about Pynche
contact: Barry A. Warsaw
email: bwarsaw@python.org''')
+
+ def __popup_text(self, event=None):
+ if not self.__textwin:
+ from TextViewer import TextViewer
+ self.__textwin = TextViewer(self.__sb, self.__root)
+ self.__sb.add_view(self.__textwin)
+ self.__textwin.deiconify()