Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / src / nas,5.n2.os.2 / lib / python / lib / python2.4 / site-packages / Pmw / Pmw_1_2 / demos / TextDialog.py
CommitLineData
86530b38
AT
1title = 'Pmw.TextDialog 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 # Create the dialog.
13 dialog = Pmw.TextDialog(parent, scrolledtext_labelpos = 'n',
14 title = 'My TextDialog',
15 defaultbutton = 0,
16 label_text = 'Lawyer jokes')
17 dialog.withdraw()
18 dialog.insert('end', jokes)
19 dialog.configure(text_state = 'disabled')
20
21 # Create button to launch the dialog.
22 w = Tkinter.Button(parent, text = 'Show text dialog',
23 command = dialog.activate)
24 w.pack(padx = 8, pady = 8)
25
26jokes = """
27Q: What do you call 5000 dead lawyers at the bottom of the ocean?
28A: A good start!
29
30Q: How can you tell when a lawyer is lying?
31A: His lips are moving.
32
33Q: Why won't sharks attack lawyers?
34A: Professional courtesy.
35
36Q: What do have when a lawyer is buried up to his neck in sand?
37A: Not enough sand.
38
39Q: How do you get a lawyer out of a tree?
40A: Cut the rope.
41
42Q: What is the definition of a shame (as in "that's a shame")?
43A: When a bus load of lawyers goes off a cliff.
44
45Q: What is the definition of a "crying shame"?
46A: There was an empty seat.
47
48Q: What do you get when you cross the Godfather with a lawyer?
49A: An offer you can't understand.
50
51Q. What do lawyers use as contraceptives?
52A. Their personalities.
53
54Q. What's brown and black and looks good on a lawyer?
55A. A doberman.
56
57Q. Why are lawyers buried 12 feet underground?
58A. Deep down their good.
59
60Q. What's the difference between a catfish and a lawyer?
61A. One's a slimy scum-sucking scavenger, the other is just a fish.
62
63"""
64######################################################################
65
66# Create demo in root window for testing.
67if __name__ == '__main__':
68 root = Tkinter.Tk()
69 Pmw.initialise(root)
70 root.title(title)
71
72 exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
73 exitButton.pack(side = 'bottom')
74 widget = Demo(root)
75 root.mainloop()