Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / v8plus / lib / python2.4 / site-packages / Pmw / Pmw_1_2 / demos / ExampleDemo.py
CommitLineData
920dae64
AT
1title = 'Pmw.EXAMPLE demonstration'
2
3# Import Pmw from this directory tree.
4import sys
5sys.path[:0] = ['../../..']
6
7import Tkinter
8import Pmw
9
10class Demo:
11 def __init__(self, parent):
12
13 # Create and pack the EXAMPLEs.
14 self.widget1 = Pmw.Counter(parent)
15 self.widget1.setentry('1')
16 self.widget1.pack()
17
18 self.widget2 = Pmw.Counter(parent, increment = 10)
19 self.widget2.setentry('100')
20 self.widget2.pack()
21
22######################################################################
23
24# Create demo in root window for testing.
25if __name__ == '__main__':
26 root = Tkinter.Tk()
27 Pmw.initialise(root)
28 root.title(title)
29
30 exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
31 exitButton.pack(side = 'bottom')
32 widget = Demo(root)
33 root.mainloop()