Dialog
subclass of Toplevel
Dialog produces "intelligent" dialog. They have a simple option to
make them resizable or not. They automatically assume a reasonable
minimum size based on their content (The dialog will be placed on the
screen and its size calculated at the first idle moment after dialog
creation. The dialog will place itself so that the mouse pointer is
is positioned over it, without being placed partly out of the screen.
If it is resized, it remembers its size for the next display.
By default, the dialog has a "Cancel" button that destroys the dialog
on invocation. Other buttons can be added easily using the add method.
Invoking a command by clicking on a button (or using a key shortcut)
will close the dialog, unless the button is persistent, or was
invoked using the Adjust mouse button.
The dialog has one component named options, which is a frame in
which optionmenus, entries, etc. can be placed.
Dialog specific options
- Command-Line Name: -closecommand
- Database Name: CloseCommand
- Database Class: closeCommand
-
commands invoked when invoking the "Cancel" button
- Command-Line Name: -closebutton
- Database Name: closeButton
- Database Class: CloseButton
-
include "Cancel" button
- Command-Line Name: -help
- Database Name: help
- Database Class: Help
-
add a help button. A file with the name helpvalue.html will
be shown in a help window whein the button is invoked
Dialog specific methods
-
pathname add button text command ?default?
-
add a button with name $button to the dialog. The button will display
the $text. When it is invoked, $command will be executed.
If the word default is added, the button will be displayed differently
and invoked by default (eg. when pressing Enter).
-
pathname delete button
-
remove the button with name $button to the dialog.
-
pathname rename button newname
-
rename the button with name $button to the dialog to $newname.
-
pathname button ?button?
-
returns a list of buttons; if button is given, returns the parameters given to this button.
-
pathname persistent ?option button ...?
-
Without arguments, the method returns a list of all persistent buttons
Option can be:
- set: make only the given buttons persistent
- add: make the given buttons persistent
- remove: make the given buttons not persistent
-
pathname invoke button ?Action/Adjust?
-
-
pathname close
-
-
pathname header text
-
-
pathname col colnum
-
-
pathname tab tabname
-
-
pathname option type label args
-
The option commands allows easy configuration of a dialog, adding tabs, text and num entries, fonts, ...
label is shown before the entry field. variable contains the value that is entered. If
you want presets, just fill in the variable.
Supported types:
- option entry label variable ?options?
-
- text entry, supports Classy::Entry options
- option numentry label variable ?options?
-
- text entry, supports Classy::NumEntry options
- option radio label variable text value ?text value? ?-- options?
-
- Set of radiobuttons given by a text value pairs. after a -- options can be given, these can be any options supported by radiobutton
- option vradio label variable text value ?text value? ?-- options?
-
- sample as radio, but radiobuttons are arranged vertically
- option check label variable text ?variable text? ?-- options?
-
- similar to radio, but with checkbuttons
- option vcheck label variable text ?variable text? ?-- options?
-
- similar to vradio, but with checkbuttons
- option button label command
-
- a button with associated command
- option buttons label buttonlabel command ?buttonlabel command?
-
- several buttons with associated command
- option file label variable ?options?
-
- entry for file selection (with browse button)
- option dir label variable ?options?
-
- entry for directory selection (with browse button)
- option select label variable listvariable
-
- select from a number of choices, the choices are a list stored in the variable listvariable
- option listbox label variable listvariable ?selectmode? ?options?
-
- selection in a listbox, choices given in listvariable
- option frame ?options?
-
- frame to fill up to your liking
- option message variable
-
- Classy::Message based option, value in variable is shown as message
- option label variable
-
- Just a line of text
- option messagedirect messagetext
-
- show message, not via variable, so it will not change
- option sort label variable ?options?
-
- variable contains a list that can be sorted by the user
- option text label variable command ?options?
-
- enter text, supports options of Classy::Selector (text type)
- option ... label variable ?options?
-
- folowing types are also supported:
int line string text color font key mouse menu toolbar anchor justify bool orient relief select sticky image bitmap
with the same options as Classy::Selector