::hwat::widgets::spinner::Spinner
Allows you to create a basic spinner widget and place in the GUI. This widget has a pair of arrow buttons, which you can click to increment or decrement a value.
Syntax
::hwat::widgets::spinner::Spinner frameName label spinnerVar
Arguments
- frameName
- Name of the parent frame where to embed a spinner.
- Label
- Spinner label.
- spinnerVar
- Global variable associated with the spinner.
- str_callback
- User’s callback which accepts only one argument: spinner value, i.e. translation value.
- [ n_width ]
- Entry field width.
- [ n_incr ]
- Increment value.
Returns
A variable associated with the spinner frame for packing purposes.
Example
pack [ ::hwat::widgets::::spinner::Spinner .top "My label" ::hwat::gui::utils::myvar "::hwat::utils::RepositionDummy"] –side top –anchor nw
set str_fr [ ::hwat::widgets::::spinner::Spinner .top "My llabel" myvar "::hwat::utils::RepositionDummy" 10 0.5 ]
pack $ str_fr - side top –anchor nw
Comments
The function call is usually followed by "pack" command to place the spinner frame into a parent frame. Be sure that "spinnerVar" is a unique name.
"n_incr" accepts any integer or double value, but if you will want to break it sending alpha, then the API is smart enough to reset it to 1.