blob: 70e5b4d6dbb2b1ef138a6ed88d222b3abd776a2a [file] [log] [blame]
Fred Drake15c417e1998-08-11 19:35:03 +00001#! /usr/bin/env python
2
3"""Script to create a window with a bunch of buttons.
4
5Once the window with the buttons is displayed on-screen, capture the image
6and make a copy for each GIF image. Use xv or similar to crop individual
7buttons & giftrans to make them transparent. xv will tell you the #value
8of the background if you press button-2 over a background pixel; that should
9be passed as a parameter to the -t argument of giftrans.
10"""
11__version__ = '$Revision$'
12
13
14import sys
15import Tkinter
16Tk = Tkinter
17
18
19def add_button(w, text):
20 b = Tk.Button(w, text=text,
21 font="-*-helvetica-medium-r-normal-*-12-*-*-*-*-*-*-*")
22 b.pack(pady=5, fill=Tk.X)
23
24def main():
25 tk = Tk.Tk()
26 w = Tk.Toplevel()
27 w.protocol("WM_DELETE_WINDOW", tk.quit)
28 tk.withdraw()
29 for word in sys.argv[1:]:
30 add_button(w, word)
31 w.mainloop()
32
33
34if __name__ == "__main__":
35 main()