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

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