button.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
---------------------------> Sather 1.1 source file <--------------------------
-- button.sa: Button widget
-- Author: Benedict A. Gomes <gomes@samosa.ICSI.Berkeley.EDU>
-- Copyright (C) 1995, International Computer Science Institute
-- button.sa,v 1.1 1995/11/15 03:36:36 gomes Exp
--
-- 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_BUTTON_CFG < $TK_WIDGET_CFG

class TK_BUTTON_CFG < $TK_WIDGET_CFG is include TK_WIDGET_CFG_INCL text->text, padx->padx, pady->pady, height->height,width->width, justify_left->justify_left,justify_right->justify_right, justify_center->justify_center, relief_none->relief_none,relief_raised->relief_raised, relief_sunken->relief_sunken, relief_flat->relief_flat,relief_ridge->relief_ridge, relief_groove->relief_groove, font->font, normal->normal,disable->disable,active->active, background->background, foreground->foreground, borderwidth->borderwidth, wraplength->wraplength, highlightcolor->highlightcolor, highlightthickness->highlightthickness, activeforeground->activeforeground, activebackground->activebackground, disabledforeground->disabledforeground; -- bitmap->bitmap, image->image, cursor->cursor, underline(char_index: INT) is config("underline",char_index.str) end; underline(char_index: INT): SAME is underline(char_index); return self end; std: SAME is return new.relief_raised end; end;

class TK_BUTTON < $TK_WIDGET

class TK_BUTTON < $TK_WIDGET is include TK_WIDGET_INCL{TK_BUTTON_CFG}; -- Redefined from WIDGET_INCL const tk_widget_type: STR := "button"; private default_init(c: TK_BUTTON_CFG) is eval(widget_name+" configure -command ", quote("sather "+ path_name+" 0")); end; private default_packing: TK_PACK is return TK_PACK::top end; private default_config: TK_BUTTON_CFG is return TK_BUTTON_CFG::std; end; -- Button specific widget interface attr command: ROUT; command(c: ROUT): SAME is command(c); return self end; flash is eval(actual_widget_name,"flash"); end; invoke is eval(actual_widget_name,"invoke"); end; act_on(id: INT,args: ARRAY{STR}) is if ~void(command) then command.call; end; end; end; -- class TK_BUTTON