/usr/share/doc/python-pmw-doc/examples/TextDialog.py is in python-pmw-doc 1.3.2-6build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | title = 'Pmw.TextDialog demonstration'
# Import Pmw from this directory tree.
import sys
sys.path[:0] = ['../../..']
import Tkinter
import Pmw
class Demo:
def __init__(self, parent):
# Create the dialog.
dialog = Pmw.TextDialog(parent, scrolledtext_labelpos = 'n',
title = 'My TextDialog',
defaultbutton = 0,
label_text = 'Lawyer jokes')
dialog.withdraw()
dialog.insert('end', jokes)
dialog.configure(text_state = 'disabled')
# Create button to launch the dialog.
w = Tkinter.Button(parent, text = 'Show text dialog',
command = dialog.activate)
w.pack(padx = 8, pady = 8)
jokes = """
Q: What do you call 5000 dead lawyers at the bottom of the ocean?
A: A good start!
Q: How can you tell when a lawyer is lying?
A: His lips are moving.
Q: Why won't sharks attack lawyers?
A: Professional courtesy.
Q: What do have when a lawyer is buried up to his neck in sand?
A: Not enough sand.
Q: How do you get a lawyer out of a tree?
A: Cut the rope.
Q: What is the definition of a shame (as in "that's a shame")?
A: When a bus load of lawyers goes off a cliff.
Q: What is the definition of a "crying shame"?
A: There was an empty seat.
Q: What do you get when you cross the Godfather with a lawyer?
A: An offer you can't understand.
Q. What do lawyers use as contraceptives?
A. Their personalities.
Q. What's brown and black and looks good on a lawyer?
A. A doberman.
Q. Why are lawyers buried 12 feet underground?
A. Deep down their good.
Q. What's the difference between a catfish and a lawyer?
A. One's a slimy scum-sucking scavenger, the other is just a fish.
"""
######################################################################
# Create demo in root window for testing.
if __name__ == '__main__':
root = Tkinter.Tk()
Pmw.initialise(root)
root.title(title)
exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
exitButton.pack(side = 'bottom')
widget = Demo(root)
root.mainloop()
|