
122
|
Python Pocket Reference
Module tkColorChooser
askcolor(color = None, **options)
Module tkFileDialog
class Open
class SaveAs
class Directory
askopenfilename(**options)
asksaveasfilename(**options)
askopenfile(mode="r", **options)
asksaveasfile(mode="w", **options)
askdirectory(**options)
The common dialog call options are defaultextension
(added to filename if not explicitly given), filetypes
(sequence of (label, pattern) tuples), initialdir (initial
directory, remembered by classes),
initialfile (initial file),
parent (window in which to place the dialog box), and title
(dialog box title).
Additional Tkinter Classes and Tools
Table 22 lists some commonly used Tkinter interfaces and
tools beyond the core widget class and standard dialog set.
Table 22. Additional Tkinter tools
Tool category Available tools
Tkinter-linked variable classes
StringVar, IntVar, DoubleVar,BooleanVar
Geometry management
methods
pack, grid, place, plus configuration options
Scheduled callbacks Widget
after, wait, and update methods; fileI/O
callbacks
Other Tkinter tools Clipboard access;
bind/Event low-level event
processing; widget config options; modal dialog
box support
Tkinter extensions (Vaults of
Parnassus site)
PMW: more widgets; PIL: images; Komodo and
PythonWorks: Tkinter GUI builder, etc.