demo_menu.sa


Generated by gen_html_sa_files from ICSI. Contact gomes@icsi.berkeley.edu for details
 
---------------------------> Sather 1.1 source file <--------------------------
-- Demo of the menu widget
-- Author: Matthias Ernst <tisi@beutlin.desy.de>
-- Copyright (C) 1995, International Computer Science Institute
-- $Id: demo_menu.sa,v 1.3 1996/08/30 22:01:43 borisv 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 DEMO_MENU

class DEMO_MENU is include GUI_UTIL; file_new is #OUT + "File::new\n"; end; file_open is #OUT + "FILE::open\n"; end; language(l: STR) is #OUT + "FILE::language::"+l+"\n"; end; do_quit is quit_routine.call; -- provided by GUI_UTIL end; init is startup_gui; file ::= #TK_MENUBUTTON(root_window, "File", TK_MENUBUTTON_CFG::std.text("File"), TK_PACK::left); file.menu. command("New", bind(file_new)). command("Open ...", bind(file_open)). separator; submenu ::= file.menu. cascade("Language") .command("English", bind(language("English"))) .command("German", bind(language("German"))); submenu.disable(submenu.index_end); -- only english supported by now file.menu. separator. command("Quit", bind(do_quit)); end; end;