-
Notifications
You must be signed in to change notification settings - Fork 1
/
ResViewer.py
81 lines (71 loc) · 2.65 KB
/
ResViewer.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#coding=utf8
import rpErrorHandler
from Tkinter import *
#------------------------------------------------------------------------------#
# #
# ResViewer #
# #
#------------------------------------------------------------------------------#
class ResViewer(Toplevel):
def __init__(self,Master=None,*pos,**kw):
#
#Your code here
#
apply(Toplevel.__init__,(self,Master),kw)
self._Frame5 = Frame(self)
self._Frame5.pack(side='top')
self._TopMenu = Menu(self._Frame5)
self._TopMenu.pack(side='left')
self._TopMenu.bind('<Map>',self._on_TopMenu_Map)
self._Frame3 = Frame(self)
self._Frame3.pack(side='top')
self._FileListFrame = Frame(self._Frame3)
self._FileListFrame.pack(side='left')
self._FileList = Listbox(self._FileListFrame)
self._FileList.pack(side='top')
self._Frame4 = Frame(self._Frame3)
self._Frame4.pack(side='left')
self._TabHost = ttk.Notebook(self._Frame4)
self._TabHost.pack(side='top')
self._Frame1 = Frame(self._Frame4)
self._Frame1.pack(side='top')
self._TextFrame = Frame(self._TabHost)
self._TextFrame.pack(side='left')
self._TextEdit = Entry(self._TextFrame)
self._TextEdit.pack(side='top')
self._CanvasFrame = Frame(self._TabHost)
self._CanvasFrame.pack(side='left')
self._Canvas = Canvas(self._CanvasFrame)
self._Canvas.pack(side='top')
self._MiscFrame = Frame(self._TabHost)
self._MiscFrame.pack(side='left')
#
#Your code here
#
self._TabHost.add(self._TextFrame, text="Text")
self._TabHost.add(self._CanvasFrame, text="Graphics")
self._TabHost.add(self._MiscFrame, text="Misc")
#
#Start of event handler methods
#
def _on_TopMenu_Map(self,Event=None):
# File menu
FileMenu = Menu(self._RootMenu, tearoff=0)
FileMenu.add_command(label="Open", command=self.openFile)
FileMenu.add_command(label="Save", command=self.saveFile)
FileMenu.add_command(label="Exit", command=exit)
self._RootMenu.add_cascade(label="File", menu=FileMenu)
pass
def openFile(self):
pass
def saveFile(self):
pass
def exit(self):
self.destroy()
pass
#
#Start of non-Rapyd user code
#
pass #---end-of-form---
import ttk, PIL, tkMessageBox
gui = ResViewer()