This is not necessarily the current version of this TIP.
|Title:||A Standard Dialog For Font Selection|
|Version:||$Revision: 1.3 $|
Adrian Robert <adrian dot b dot robert at gmail dot com>|
Adrian Robert <Adrian dot B dot Robert at gmail dot com>
|Created:||Friday, 08 August 2008|
This TIP proposes a new command that pops up a dialog box that allows the selection of a font. Where possible, this dialog will be implemented using the host platform's standard dialogs.
A number of platforms (Windows and MacOSX) have standard dialogs for common user-oriented tasks, and Tk provides an interface to these dialogs through commands such as tk_getOpenFile and tk_chooseColor. However, another dialog that they provide and which some programs would find useful is a font selector. This TIP proposes adding a command to do just that; where a platform does not provide such a standard dialog, one implemented using a Tcl script will be used instead.
Tk shall have a new command, tk_chooseFont, with the syntax described below.
The dialog will not return a result as on some platforms (MacOSX) this is required to be modeless while on others (Windows) it must be modal. Therefore all actions will be done via a configured command prefix registered with tk_chooseFont configure -command. In the modal case clicking either the Apply button (if present) or the OK button will cause the command prefix to be called with the font specification appended as an additional argument. If Cancel is chosen, or the dialog is closed manually on platforms that permit this, this will be called with an empty string. (It will not be so called otherwise.)
tk_chooseFont configure <