radio.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
---------------------------> Sather 1.1 source file <--------------------------
-- Author: Holger Klawitter <holger@icsi.berkeley.edu>
-- Copyright (C) 1995, International Computer Science Institute
--
-- COPYRIGHT NOTICE: This code is provided WITHOUT ANY WARRANTY
-- and is subject to the terms of the SATHER LIBRARY GENERAL PUBLIC
-- LICENSE contained in the file: Sather/Doc/License of the
-- Sather distribution. The license is also available from ICSI,
-- 1947 Center St., Suite 600, Berkeley CA 94704, USA.


class TK_RADIO_CFG

class TK_RADIO_CFG is include TK_BUTTON_CFG; variable(v:TK_VAR) -- Variable associated to this widget. Changes to the variable -- cause the widget to update and user actions on this widget -- may change the value of the variable. is config("variable",v.str); end; val(s:STR) -- Value for the variable when the radiobutton is selected. is config("value",s); end; variable(v:TK_VAR): SAME is variable(v); return self; end; val(s:STR): SAME is val(s); return self; end; std: SAME is return new end; end; -- class TK_RADIO_CFG

class TK_RADIO < $TK_WIDGET

class TK_RADIO < $TK_WIDGET -- Wiget representing radio buttons. is include TK_WIDGET_INCL{TK_RADIO_CFG}; const tk_widget_type: STR := "radiobutton"; private default_init(c:TK_RADIO_CFG) is eval(widget_name+" configure -command ", quote("sather "+path_name+" 0")); end; private default_config: TK_RADIO_CFG is return TK_RADIO_CFG::std end; invoke is eval(actual_widget_name,"invoke") end; flash is eval(actual_widget_name,"flash") end; select -- Selecing a radio button delselects all other radio buttons -- associated to the same variable. is eval(actual_widget_name,"select") end; deselect is eval(actual_widget_name,"deselect") end; attr command: ROUT; command(c:ROUT): SAME is command(c); return self; end; act_on(id:INT,args:ARRAY{STR}) is if ~void(command) then command.call; end end; end; -- class TK_RADIO