1 title = 'Pmw.ScrolledField demonstration'
3 # Import Pmw from this directory tree.
5 sys.path[:0] = ['../../..']
11 def __init__(self, parent):
12 # Create and pack the ScrolledField.
13 self._field = Pmw.ScrolledField(parent, entry_width = 30,
14 entry_relief='groove', labelpos = 'n',
15 label_text = 'Scroll the field using the\nmiddle mouse button')
16 self._field.pack(fill = 'x', expand = 1, padx = 10, pady = 10)
18 # Create and pack a button to change the ScrolledField.
19 self._button = Tkinter.Button(parent, text = 'Change field',
20 command = self.execute)
21 self._button.pack(padx = 10, pady = 10)
27 self._field.configure(text = lines[self._index % len(lines)])
28 self._index = self._index + 1
31 'Alice was beginning to get very tired of sitting by her sister',
32 'on the bank, and of having nothing to do: once or twice she had',
33 'peeped into the book her sister was reading, but it had no',
34 'pictures or conversations in it, "and what is the use of a book,"',
35 'thought Alice "without pictures or conversation?"',
36 'Alice\'s Adventures in Wonderland',
40 ######################################################################
42 # Create demo in root window for testing.
43 if __name__ == '__main__':
48 exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
49 exitButton.pack(side = 'bottom')