%angel

babyedenwin = window {
   title = "Baby Eden";
   content = [accept,txt,showhide,exit] };

accept = button {
   text = "Accept";
   side = "left" };

txt = textbox {
   width = 30;
   height = 1;
   side = "left" };
   
showhide = button {
   side = "left" };

exit = button {
   text = "Quit";
   side = "left" };
 
showhide.text = hidden ? "Show" : "Hide";

%eden

hidden = 0;

proc trigger_showhide : showhide_mouseclick {
   if (showhide_mouseclick == 0) {
      if (hidden) {
         hidden = 0;
	 tcl("wm deiconify .");
      }
      else {
         hidden = 1;
	 tcl("wm withdraw .");
      }
   }   
}

proc trigger_execute : accept_mouseclick {
   if (accept_mouseclick == 0) {
      if (txt_text != @)
         execute(txt_text);
      txt_text = "";
   }
}

proc trigger_exit : exit_mouseclick {
   if (exit_mouseclick == 0) {
      tcl("close $histfile; quit;");
   }
}



