- NAME
- Utilities
- General-purpose utilities that are part of Slab
- COMMAND
- Slab::XLFDfont
cmd
?arg...?
- Slab::assert
exp
?msg?
- Slab::badOptionString
type
value
list
- Slab::bindMouseWheel
widget
- Slab::classes
class
- Slab::clonename
menu
- Slab::focus
set|release
path
?refocus?
- Slab::get3dcolor
path
bgcolor
- Slab::getname
name
- Slab::grab
set|global|release
path
- Slab::inuse
class
- Slab::library
class ?class ...?
- Slab::lreorder
list
neworder
- Slab::parsetext
text
- Slab::place
path
w
h
?arg...?
- Slab::write
filename ?mode?
- Slab::wrongNumArgsString
string
- Slab::Widget::focusNext
w
- Slab::Widget::focusOK
w
- Slab::Widget::focusPrev
w
- Slab::Widget::theme
?bool?
- Slab::Widget::traverseTo
w
DESCRIPTION
General-purpose utilities that are part of Slab. These commands are used internally by Slab, and might be useful for other purposes.
COMMAND
- Slab::XLFDfont
cmd
?arg...?
-
Command for processing X11 font descriptions in the obsolete X Logical Font Description (XLFD) style. Most X11 systems now use Fontconfig instead of XLFD.
- Slab::assert
exp
?msg?
-
Use expr to evaluate the expression exp in the context of the caller. Return with error status if the result is not boolean true. If msg is supplied, it will be used as the error message.
- Slab::badOptionString
type
value
list
-
Return a proper error string for a value of type that doesn't
match list.
- Slab::bindMouseWheel
widget
-
Bind the given widget with the standard mouse wheel bindings.
- Slab::classes
class
-
Returns a list of classes needed by the given class.
This was mostly useful in BWidget for saving BWidgets to another project.
It has not been adapted for use with Slab.
- Slab::clonename
menu
-
Given the Tk window path of a menu, return the name of its clone that is used in a menubar constructed by Tk.
- Slab::focus
set|release
path
?refocus?
-
Option set - use ::focus -force to set focus on window path, and add path to a stack of focus history. Option release - remove any occurrences of path and of windows that no longer exist from the top of the stack. If refocus is true, use ::focus -force to set focus on the window at the top of the stack. When coding, take care to distinguish this command from ::focus.
- Slab::get3dcolor
path
bgcolor
-
Return a list of two 48-bit colors, darker and lighter respectively than the argument bgcolor. The R, G and B values of the darker color are 60% those of bgcolor: those of the lighter color are larger than those of bgcolor, and are constrained to lie between 32767 and 65535. The colors are useful when shading a widget to give it a 3D appearance.
- Slab::getname
name
-
Command used to obtain and process i18n text for a "named" widget. The i18n key is the argument name with the string "Name" appended. If a translated value can be found, it is returned as a list of two values (plain text and underline position) after parsing through Slab::parsetext. If no translated value can be found, the argument name itself is parsed through Slab::parsetext (without the suffix "Name").
- Slab::grab
set|global|release
path
-
Option set - if a grab has been set on a window, add the window path and grab status (global/non-global) to a stack of grab history; then set a grab on window path. Option global - the same as option set, but a global grab is applied. Option release - release the grab on path; then remove any occurrences of path and of windows that no longer exist from the top of the stack. Consume the next value from the stack, and restore the grab that it records. When coding, take care to distinguish this command from ::grab.
- Slab::inuse
class
-
Returns true or false if the given class is being used by the
current running program.
This was mostly useful in BWidget for saving BWidgets to another project.
It has not been adapted for use with Slab.
- Slab::library
class
?class ...?
-
Returns a string of code that contains all the libraries needed to
use the widgets given by class. Each class's code and the
code of its dependent classes is appended to the string and returned.
This was mostly useful in BWidget for saving BWidgets to another project.
It has not been adapted for use with Slab.
- Slab::lreorder
list
neworder
-
Used in Slab::Tree and Slab::ListBox for reordering a list.
- Slab::parsetext
text
-
Return a list of two values. The first value is a mapping of the argument text with all occurrences of the character "&" removed, except that pairs "&&" are mapped as literal "&". The second value is the position in the first value of the character that was preceded in the argument by the final non-literal "&". If there is no such character, this value is -1, {} in Tk 8, 9 respectively. The command is used to interpret text strings that have embedded "&" to indicate a character to be underlined, for example, when using the text on a button.
- Slab::place
path
w
h
?arg...?
-
Used to position and resize the widget specified by
path. w and h are used to specify the requested
width and height of the path widget for use by wm
geometry (set to 0 to use current values). The placement of the widget relative to other widgets or
the screen is controlled by additional arguments:
- at x y
- Place the widget specified by the path argument at screen
position x,y. See wm geometry for information about window
placement values.
- center ?widget?
- Place the path widget centered against widget or against the
root widget if widget is not given.
- left ?widget?
- right ?widget?
- Place the path widget either left or right of the
reference widget (or the root widget if widget is not
specified). If the reference widget's position is such that the newly
placed window might be obscured then the opposite side will be tried.
- above ?widget?
- below ?widget?
- As for left/right above, this option causes the widget to be
placed either above or below the reference widget with the opposite
placement being attempted if the newly placed widget will not be visible.
- Slab::write
filename
?mode?
-
(Obsolete) Writes the currently used set of BWidget class code to the given
filename. All the code necessary to run the BWidgets
currently in use is written to the file. This was mostly useful
in BWidget for saving widget code to another project as a single file
instead of the entire BWidget package. It has not been adapted for
use with Slab.
- Slab::wrongNumArgsString
string
-
Returns a standard error string for the wrong number of arguments.
string is appended to the standard string.
- Slab::Widget::focusNext
w
-
Same as tk_focusNext, except that it uses Slab::Widget::focusOK instead of tk::focusOK.
- Slab::Widget::focusOK
w
-
Same as tk_focusOK, but it takes into account whether window w has an -editable option with value 0, and it looks for Key* bindings in each bindtag of w except all and the bindtag for the toplevel of w.
- Slab::Widget::focusPrev
w
-
Same as tk_focusPrev, except that it does not traverse from a child to a direct ancestor, and it uses Slab::Widget::focusOK instead of tk::focusOK.
- Slab::Widget::theme
?bool?
-
Get or set whether Slab widgets are themed.
- Slab::Widget::traverseTo
w
-
If the focus is on a window of this application, generate a <<TraverseOut>> event on that window. Then move focus to window w, and generate a <<TraverseIn>> event on w.