home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / man / cat.n / checkbutton.n < prev    next >
Encoding:
Text File  |  1995-07-26  |  19.6 KB  |  330 lines

  1.  
  2.  
  3.  
  4.      cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))               TTTTkkkk (((( ))))                cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))
  5.  
  6.  
  7.  
  8.      _________________________________________________________________
  9.  
  10.      NNNNAAAAMMMMEEEE
  11.           checkbutton - Create and manipulate check-button widgets
  12.  
  13.      SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
  14.           cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn _p_a_t_h_N_a_m_e ?_o_p_t_i_o_n_s?
  15.  
  16.      SSSSTTTTAAAANNNNDDDDAAAARRRRDDDD OOOOPPPPTTTTIIIIOOOONNNNSSSS
  17.           aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd               bbbbiiiittttmmmmaaaapppp          ffffoooonnnnttttrrrreeeelllliiiieeeeffff     |
  18.           aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd               bbbboooorrrrddddeeeerrrrWWWWiiiiddddtttthhhh     ffffoooorrrreeeeggggrrrroooouuuunnnnddddtttteeeexxxxtttt |
  19.           aaaannnncccchhhhoooorrrr          ccccuuuurrrrssssoooorrrr         ppppaaaaddddXXXX            tttteeeexxxxttttVVVVaaaarrrriiiiaaaabbbblllleeee   |
  20.           bbbbaaaacccckkkkggggrrrroooouuuunnnndddd      ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd             ppppaaaaddddYYYY           |
  21.  
  22.           See the ``options'' manual entry for details on the standard
  23.           options.
  24.  
  25.      WWWWIIIIDDDDGGGGEEEETTTT----SSSSPPPPEEEECCCCIIIIFFFFIIIICCCC OOOOPPPPTTTTIIIIOOOONNNNSSSS
  26.           Name:           ccccoooommmmmmmmaaaannnndddd
  27.           Class:          CCCCoooommmmmmmmaaaannnndddd
  28.           Command-Line Switch:----ccccoooommmmmmmmaaaannnndddd
  29.  
  30.                Specifies a Tcl command to associate with  the  button.
  31.                This  command  is typically invoked when mouse button 1
  32.                is released  over  the  button  window.   The  button's
  33.                global  variable  (----vvvvaaaarrrriiiiaaaabbbblllleeee  option)  will  be updated
  34.                before the command is invoked.
  35.  
  36.           Name:           hhhheeeeiiiigggghhhhtttt                                        |
  37.           Class:          HHHHeeeeiiiigggghhhhtttt                                        |
  38.           Command-Line Switch:----hhhheeeeiiiigggghhhhtttt                                   |
  39.  
  40.                                                                              ||
  41.                Specifies a desired height for the button.  If a bitmap  |
  42.                is being displayed in the button then the value  is  in  |
  43.                screen  units  (i.e.  any  of  the  forms acceptable to  |
  44.                TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is in  lines  of  text.   If  |
  45.                this  option  isn't  specified,  the  button's  desired  |
  46.                height is computed from the size of the bitmap or  text  |
  47.                being displayed in it.
  48.  
  49.           Name:           ooooffffffffVVVVaaaalllluuuueeee
  50.           Class:          VVVVaaaalllluuuueeee
  51.           Command-Line Switch:----ooooffffffffvvvvaaaalllluuuueeee
  52.  
  53.                Specifies value to store  in  the  button's  associated
  54.                variable  whenever this button is deselected.  Defaults
  55.                to ``0''.
  56.  
  57.           Name:           oooonnnnVVVVaaaalllluuuueeee
  58.           Class:          VVVVaaaalllluuuueeee
  59.           Command-Line Switch:----oooonnnnvvvvaaaalllluuuueeee
  60.  
  61.  
  62.  
  63.      Page 1                                          (printed 7/23/95)
  64.  
  65.  
  66.  
  67.  
  68.  
  69.  
  70.      cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))               TTTTkkkk (((( ))))                cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))
  71.  
  72.  
  73.  
  74.                Specifies value to store  in  the  button's  associated
  75.                variable whenever this button is selected.  Defaults to
  76.                ``1''.
  77.  
  78.           Name:           sssseeeelllleeeeccccttttoooorrrr
  79.           Class:          FFFFoooorrrreeeeggggrrrroooouuuunnnndddd
  80.           Command-Line Switch:----sssseeeelllleeeeccccttttoooorrrr
  81.  
  82.                Specifies the color to draw in the selector  when  this
  83.                button  is  selected.   If specified as an empty string  |
  84.                then no selector is drawn for the button.                |
  85.  
  86.           Name:           ssssttttaaaatttteeee                                         |
  87.           Class:          SSSSttttaaaatttteeee                                         |
  88.           Command-Line Switch:----ssssttttaaaatttteeee                                    |
  89.  
  90.                                                                              ||
  91.                Specifies  one  of  three  states for the check button:  |
  92.                nnnnoooorrrrmmmmaaaallll, aaaaccccttttiiiivvvveeee, or ddddiiiissssaaaabbbblllleeeedddd.  In normal state the check  |
  93.                button is displayed using the ffffoooorrrreeeeggggrrrroooouuuunnnndddd and bbbbaaaacccckkkkggggrrrroooouuuunnnndddd  |
  94.                options.  The active state is typically used  when  the  |
  95.                pointer  is over the check button.  In active state the  |
  96.                check button is displayed  using  the  aaaaccccttttiiiivvvveeeeFFFFoooorrrreeeeggggrrrroooouuuunnnndddd  |
  97.                and  aaaaccccttttiiiivvvveeeeBBBBaaaacccckkkkggggrrrroooouuuunnnndddd  options.   Disabled  state means  |
  98.                that the  check  button  is  insensitive:   it  doesn't  |
  99.                activate  and  doesn't respond to mouse button presses.  |
  100.                In this state  the  ddddiiiissssaaaabbbblllleeeeddddFFFFoooorrrreeeeggggrrrroooouuuunnnndddd  and  bbbbaaaacccckkkkggggrrrroooouuuunnnndddd  |
  101.                options determine how the check button is displayed.
  102.  
  103.           Name:           vvvvaaaarrrriiiiaaaabbbblllleeee
  104.           Class:          VVVVaaaarrrriiiiaaaabbbblllleeee
  105.           Command-Line Switch:----vvvvaaaarrrriiiiaaaabbbblllleeee
  106.  
  107.                Specifies name of global variable to  set  to  indicate
  108.                whether  or  not  this button is selected.  Defaults to
  109.                the name of the button within its parent (i.e. the last
  110.                element of the button window's path name).
  111.  
  112.           Name:           wwwwiiiiddddtttthhhh                                         |
  113.           Class:          WWWWiiiiddddtttthhhh                                         |
  114.           Command-Line Switch:----wwwwiiiiddddtttthhhh                                    |
  115.  
  116.                                                                              ||
  117.                Specifies  a desired width for the button.  If a bitmap  |
  118.                is being displayed in the button then the value  is  in  |
  119.                screen  units  (i.e.  any  of  the  forms acceptable to  |
  120.                TTTTkkkk____GGGGeeeettttPPPPiiiixxxxeeeellllssss); for text it is in characters.   If  this  |
  121.                option  isn't  specified, the button's desired width is  |
  122.                computed from the size of  the  bitmap  or  text  being  |
  123.                displayed in it.
  124.      _________________________________________________________________
  125.  
  126.  
  127.  
  128.  
  129.      Page 2                                          (printed 7/23/95)
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.      cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))               TTTTkkkk (((( ))))                cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))
  137.  
  138.  
  139.  
  140.      DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
  141.           The cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn command creates a new window (given  by  the
  142.           _p_a_t_h_N_a_m_e  argument) and makes it into a check-button widget.
  143.           Additional options, described above, may be specified on the
  144.           command  line or in the option database to configure aspects
  145.           of the check button such as  its  colors,  font,  text,  and
  146.           initial   relief.    The  cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn  command  returns  its
  147.           _p_a_t_h_N_a_m_e argument.  At the time  this  command  is  invoked,
  148.           there must not exist a window named _p_a_t_h_N_a_m_e, but _p_a_t_h_N_a_m_e's
  149.           parent must exist.
  150.  
  151.           A check button is a widget that displays a textual string or  |
  152.           bitmap  and  a square called a _s_e_l_e_c_t_o_r.  A check button has  |
  153.           all of the  behavior  of  a  simple  button,  including  the  |
  154.           following:   it  can  display  itself  in  either  of  three  |
  155.           different ways, according to the ssssttttaaaatttteeee  option;  it  can  be
  156.           made  to  appear  raised, sunken, or flat; it can be made to
  157.           flash; and it invokes a Tcl command whenever mouse button  1
  158.           is clicked over the check button.
  159.  
  160.           In addition, check buttons can  be  _s_e_l_e_c_t_e_d.   If  a  check
  161.           button  is  selected then a special highlight appears in the
  162.           selector, and a  Tcl  variable  associated  with  the  check
  163.           button  is  set  to a particular value (normally 1).  If the
  164.           check button is not selected, then the selector is drawn  in
  165.           a  different fashion and the associated variable is set to a
  166.           different value (typically 0).  By default, the name of  the
  167.           variable  associated  with a check button is the same as the
  168.           _n_a_m_e used to create the check button.   The  variable  name,
  169.           and  the  ``on''  and  ``off''  values  stored in it, may be
  170.           modified with options on the command line or in  the  option
  171.           database.  By default a check button is configured to select
  172.           and  deselect  itself  on  alternate  button   clicks.    In  |
  173.           addition, each check button monitors its associated variable  |
  174.           and automatically selects  and  deselects  itself  when  the  |
  175.           variables  value  changes  to  and  from the button's ``on''  |
  176.           value.
  177.  
  178.  
  179.      WWWWIIIIDDDDGGGGEEEETTTT CCCCOOOOMMMMMMMMAAAANNNNDDDD
  180.           The cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn command creates a new Tcl command whose name
  181.           is  _p_a_t_h_N_a_m_e.   This  command  may be used to invoke various
  182.           operations on the widget.   It  has  the  following  general
  183.           form:
  184.  
  185.                _p_a_t_h_N_a_m_e _o_p_t_i_o_n ?_a_r_g _a_r_g ...?
  186.           _O_p_t_i_o_n and the _a_r_gs determine  the  exact  behavior  of  the
  187.           command.   The  following  commands  are  possible for check
  188.           button widgets:
  189.  
  190.           _p_a_t_h_N_a_m_e aaaaccccttttiiiivvvvaaaatttteeee
  191.                Change the check button's state to aaaaccccttttiiiivvvveeee and redisplay
  192.  
  193.  
  194.      Page 3                                          (printed 7/23/95)
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.      cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))               TTTTkkkk (((( ))))                cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))
  202.  
  203.  
  204.  
  205.                the  button  using its active foreground and background
  206.                colors instead  of  normal  colors.   This  command  is  |
  207.                ignored  if the check button's state is ddddiiiissssaaaabbbblllleeeedddd.  This  |
  208.                command is obsolete and will eventually be removed; use  |
  209.                ``_p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ----ssssttttaaaatttteeee aaaaccccttttiiiivvvveeee'' instead.
  210.  
  211.           _p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee ?_o_p_t_i_o_n? ?_v_a_l_u_e _o_p_t_i_o_n _v_a_l_u_e ...?
  212.                Query  or  modify  the  configuration  options  of  the
  213.                widget.   If  no  _o_p_t_i_o_n  is  specified, returns a list
  214.                describing all of the available  options  for  _p_a_t_h_N_a_m_e
  215.                (see  TTTTkkkk____CCCCoooonnnnffffiiiigggguuuurrrreeeeIIIInnnnffffoooo for information on the format of
  216.                this list).  If _o_p_t_i_o_n is specified with no _v_a_l_u_e, then
  217.                the  command  returns  a  list describing the one named
  218.                option  (this   list   will   be   identical   to   the
  219.                corresponding  sublist  of  the  value  returned  if no
  220.                _o_p_t_i_o_n is specified).   If  one  or  more  _o_p_t_i_o_n-_v_a_l_u_e
  221.                pairs  are  specified,  then  the  command modifies the
  222.                given widget option(s) to have the given value(s);   in
  223.                this  case the command returns an empty string.  _O_p_t_i_o_n
  224.                may have any of the values accepted by the  cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn
  225.                command.
  226.  
  227.           _p_a_t_h_N_a_m_e ddddeeeeaaaaccccttttiiiivvvvaaaatttteeee
  228.                Change the check button's state to nnnnoooorrrrmmmmaaaallll and redisplay
  229.                the  button  using its normal foreground and background
  230.                colors.  This command is ignored if the check  button's  |
  231.                state  is  ddddiiiissssaaaabbbblllleeeedddd.  This command is obsolete and will  |
  232.                eventually be removed; use ``_p_a_t_h_N_a_m_e ccccoooonnnnffffiiiigggguuuurrrreeee  ----ssssttttaaaatttteeee  |
  233.                nnnnoooorrrrmmmmaaaallll'' instead.
  234.  
  235.           _p_a_t_h_N_a_m_e ddddeeeesssseeeelllleeeecccctttt
  236.                Deselect the check  button:   redisplay  it  without  a
  237.                highlight  in  the  selector  and  set  the  associated
  238.                variable to its ``off'' value.
  239.  
  240.           _p_a_t_h_N_a_m_e ffffllllaaaasssshhhh
  241.                Flash  the  check  button.   This  is  accomplished  by
  242.                redisplaying    the   check   button   several   times,
  243.                alternating between active and normal colors.   At  the
  244.                end  of  the flash the check button is left in the same
  245.                normal/active state as when the  command  was  invoked.  |
  246.                This  command is ignored if the check button's state is  |
  247.                ddddiiiissssaaaabbbblllleeeedddd.
  248.  
  249.           _p_a_t_h_N_a_m_e iiiinnnnvvvvooookkkkeeee
  250.                Does just what would have happened if the user  invoked  |
  251.                the  check  button with the mouse: toggle the selection  |
  252.                state  of  the  button  and  invoke  the  Tcl   command  |
  253.                associated with the check button, if there is one.  The  |
  254.                return value is the return value from the Tcl  command,  |
  255.                or  an  empty  string if there is no command associated  |
  256.                with the check button.  This command is ignored if  the  |
  257.  
  258.  
  259.  
  260.      Page 4                                          (printed 7/23/95)
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.      cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))               TTTTkkkk (((( ))))                cccchhhheeeecccckkkkbbbbuuuuttttttttoooonnnn((((nnnn))))
  268.  
  269.  
  270.  
  271.                check button's state is ddddiiiissssaaaabbbblllleeeedddd.
  272.  
  273.           _p_a_t_h_N_a_m_e sssseeeelllleeeecccctttt
  274.                Select the check button:  display it with a highlighted
  275.                selector  and set the associated variable to its ``on''
  276.                value.
  277.  
  278.           _p_a_t_h_N_a_m_e ttttoooogggggggglllleeee
  279.                Toggle the selection state of the button,  redisplaying
  280.                it and modifying its associated variable to reflect the
  281.                new state.
  282.  
  283.  
  284.      BBBBIIIINNNNDDDDIIIINNNNGGGGSSSS
  285.           Tk automatically creates class bindings  for  check  buttons  |
  286.           that give them the following default behavior:                |
  287.  
  288.           [1]                                                                ||
  289.                The  check  button  activates whenever the mouse passes  |
  290.                over it and deactivates whenever the mouse  leaves  the  |
  291.                check button.                                            |
  292.  
  293.           [2]                                                                ||
  294.                The check button's relief is changed to sunken whenever  |
  295.                mouse button 1 is pressed over it, and  the  relief  is  |
  296.                restored  to  its original value when button 1 is later  |
  297.                released.                                                |
  298.  
  299.           [3]                                                                ||
  300.                If  mouse button 1 is pressed over the check button and  |
  301.                later released over the check button, the check  button  |
  302.                is  invoked  (i.e.  its selection state toggles and the  |
  303.                command associated with the button is invoked, if there  |
  304.                is  one).   However, if the mouse is not over the check  |
  305.                button when button 1 is released,  then  no  invocation  |
  306.                occurs.                                                  |
  307.  
  308.           If the check button's state is ddddiiiissssaaaabbbblllleeeedddd  then  none  of  the  |
  309.           above  actions  occur:   the check button is completely non-  |
  310.           responsive.                                                   |
  311.  
  312.           The behavior of check buttons can be changed by defining new  |
  313.           bindings  for  individual widgets or by redefining the class  |
  314.           bindings.
  315.  
  316.  
  317.      KKKKEEEEYYYYWWWWOOOORRRRDDDDSSSS
  318.           check button, widget
  319.  
  320.  
  321.  
  322.  
  323.  
  324.  
  325.  
  326.      Page 5                                          (printed 7/23/95)
  327.  
  328.  
  329.  
  330.