check.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.


immutable class TK_VAR

immutable class TK_VAR is include TK_TAG_INCL; query: STR is return GUI_APP_END::eval("queryVariable "+str); end; end; -- class TKVAR

class TK_CHECK_CFG < $TK_WIDGET_CFG

class TK_CHECK_CFG < $TK_WIDGET_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; on_value(s:STR) -- Value for the associated variable when the checkbox is selected. is config("onvalue",s); end; off_value(s:STR) -- Value for the associated variable when the checkbox is not selected. is config("offvalue",s); end; -- For conveniant usage. variable(v:TK_VAR): SAME is variable(v); return self; end; on_value(s:STR): SAME is on_value(s); return self; end; off_value(s:STR): SAME is off_value(s); return self; end; std: SAME is return new.relief_flat end; end; -- class TK_CHECK_CFG

class TK_CHECK < $TK_WIDGET

class TK_CHECK < $TK_WIDGET -- Widget representing checkboxes (checkbuttons in TkTcl). is include TK_WIDGET_INCL{TK_CHECK_CFG}; const tk_widget_type: STR := "checkbutton"; private default_init(c:TK_CHECK_CFG) is eval(widget_name+" configure -command ", quote("sather "+path_name+" 0")); end; private default_config: TK_CHECK_CFG is return TK_CHECK_CFG::std end; invoke is eval(actual_widget_name,"invoke") end; flash is eval(actual_widget_name,"flash") end; -- Routines to change the state of the widget. select is eval(actual_widget_name,"select") end; deselect is eval(actual_widget_name,"deselect") end; toggle is eval(actual_widget_name,"toggle") end; readonly attr command: ROUT; -- Associated command which will be invoked when the checkbox -- is selected. 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_CHECK