Constructs related to ::tycho::ColorBrowser


Related class: ::tycho::ColorBrowser Contents: Proc

Proc

::tycho::querycolor {string {default {}}}
Query the user for a color and return it. This procedure brings up a simple color browser, and returns only when that browser is dismissed. The returned string is the name of a color. If the user cancels the dialog, the given default (or null if not given) is returned. This name should be passed to ::tycho::color before being used, to convert it to a standard color format recognized by all installations. One argument is required: a string that labels the query. If a second argument is given, it is the default color in the entry box.

This procedure indirectly calls update, a Tk utility that processes pending events, including mouse events. If this procedure is called from within an Itcl object, directly or indirectly, it may be necessary to take precautions to prevent the calling object from being deleted during the call. Because of a defect in at least some versions of Itcl, failure to do so can result in catastrophic failure of the application (a core dump). In Tycho objects, the safeEval method should be used to evaluate this procedure or any method or procedure that in turn calls this procedure. If the procedure is called from the top level or from a Tcl procedure that is not itself called from within an Itcl object, then there is no cause for worry.

Index of classes



Author: Edward A. Lee
Version: @(#)ColorBrowser.itcl 1.8 12/10/96
Copyright: (c) 1995-1996 The Regents of the University of California.