Joy Online Manual

NAME
joy::promptPanel - Generic prompt panel

SYNOPSIS

joy::promptPanel title prompt ?text? ?defaultButton? ?alternateButton?

DESCRIPTION
Brings up a modal panel asking the user to input a string. title is a Tcl string which is displayed in larger letters on top of the panel, prompt is a Tcl string which is displayed above the input field, and text is a Tcl string which is preselected in the input field (defaults to an empty string).  The two remaining optional parameters are the titles of the panel's two buttons (again as Tcl strings).  defaultButton defaults to the application's localized version of "OK" and  alternateButton to the localized version of "Cancel".
The procedure returns a Tcl list where the first element is 0 if the alternate button was pressed and 1 if the default button was pressed.  The second element is the string entered by the user (again as a Tcl string).

This command is especially useful when implementing services with Joy.

EXAMPLE

tcl> lassign [joy::promptPanel Example "Favorite color" blue] button color
tcl> set button
1
tcl> set color
green

SEE ALSO

joy::logPanel

Index