1usual(n)                           [incr Tk]                          usual(n)
2
3
4
5______________________________________________________________________________
6

NAME

8       usual - access default option-handling commands
9            for a mega-widget component
10

SYNOPSIS

12       usual ?tag? ?commands?
13_________________________________________________________________
14
15

DESCRIPTION

17       The  usual command is used outside of an [incr Tcl] class definition to
18       define the usual set of option-handling commands for a  component  wid‐
19       get.   Option-handling commands are used when a component is registered
20       with the Archetype base class via the "itk_component add" method.  They
21       specify  how the component's configuration options should be integrated
22       into the composite option list for the  mega-widget.   Options  can  be
23       kept, renamed, or ignored, as described in the Archetype man page.
24
25       It is tedious to include the same declarations again and again whenever
26       components are added.  The usual command allows a standard  code  frag‐
27       ment  to  be registered for each widget class, which is used by default
28       to handle the options.  All of the standard Tk widgets have usual  dec‐
29       larations defined in the [incr Tk] library.  Similar usual declarations
30       should be created whenever a new mega-widget class is conceived.   Only
31       the most-generic options should be included in the usual declaration.
32
33       The tag name is usually the name of a widget class, which starts with a
34       capital letter; however, any string registered here can be  used  later
35       with the usual command described on the Archetype man page.
36
37       If  the  commands  argument is specified, it is associated with the tag
38       string, and can be accessed later via itk_component add.
39
40       If only the tag argument is specified, this command looks for an exist‐
41       ing tag name and returns the commands associated with it.  If there are
42       no commands associated with tag, this command returns the null string.
43
44       If no arguments are specified, this command returns a list of  all  tag
45       names previously registered.
46
47

EXAMPLE

49       Following is the usual declaration for the standard Tk button widget:
50              itk::usual Button {
51                  keep -background -cursor -foreground -font
52                  keep -activebackground -activeforeground -disabledforeground
53                  keep -highlightcolor -highlightthickness
54                  rename -highlightbackground -background background Background
55              }
56       Only  the options that would be common to all buttons in a single mega-
57       widget are kept or renamed.  Options like "-text" that would be  unique
58       to a particular button are ignored.
59
60

KEYWORDS

62       itk, Archetype, component, mega-widget
63
64
65
66itk                                   3.0                             usual(n)
Impressum