Fred Drake | 15c417e | 1998-08-11 19:35:03 +0000 | [diff] [blame] | 1 | #! /usr/bin/env python |
| 2 | |
| 3 | """Script to create a window with a bunch of buttons. |
| 4 | |
| 5 | Once the window with the buttons is displayed on-screen, capture the image |
| 6 | and make a copy for each GIF image. Use xv or similar to crop individual |
| 7 | buttons & giftrans to make them transparent. xv will tell you the #value |
| 8 | of the background if you press button-2 over a background pixel; that should |
| 9 | be passed as a parameter to the -t argument of giftrans. |
| 10 | """ |
| 11 | __version__ = '$Revision$' |
| 12 | |
| 13 | |
| 14 | import sys |
| 15 | import Tkinter |
| 16 | Tk = Tkinter |
| 17 | |
| 18 | |
| 19 | def 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 | |
| 24 | def 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 | |
| 34 | if __name__ == "__main__": |
| 35 | main() |