# Filename: D:\Studienarbeit\Beispiel4\Main.tcl
# Version: 1.0 
# Date: Tue Sept 8 
# Author: junge 

set init 0
set go 0
proc put_win { str } {
  global AusgabeFenster
  $AusgabeFenster insert end $str;
  $AusgabeFenster yview moveto 1.0;
}

proc makeTopLevel {winName} {
  toplevel $winName
  menu $winName.menu -tearoff 0
  menu $winName.menu.look -tearoff 0   -background gray
  $winName.menu add cascade -label Look -menu $winName.menu.look
  $winName configure -menu $winName.menu

  wm protocol $WinName WM_DELETE_WINDOW {tk_messageBox -parent . \
          -title Achtung -icon warning -type ok \
          -message {Beenden Sie die Animation ueber ihr Menue!}}
}
 
#wm geometry . 380x300
frame .butleiste
button .butinit -text {InitGrafik} -command  {
           put_win "InitGrafik!\n";
           global init; set init 1;
           action Init;
         }
button .butgo -text {NewView} -command  {\
           if { $init } { action NewView;}
         }
button .butanimate -text {Animate} -command {\
           action Animate;
         } 
button .butsichern -text {Sichern} -command {\
           action Sichern;
         } 
button .exit -text Exit -command { \
         action ExitTest;
         after 1000 { exit}
         }

frame .out


set AusgabeFenster .out.text
text $AusgabeFenster -height 90 -yscrollcommand ".out.text.scy set" \
                                -xscrollcommand ".out.text.scx set"
scrollbar .out.text.scy -command { \
               global AusgabeFenster
               $AusgabeFenster yview}
scrollbar .out.text.scx -orient horizontal -command { \
               global AusgabeFenster
               $AusgabeFenster xview}

frame .client 
frame .client.drawXY
frame .client.drawZ
frame .client.drawXY.drawX
frame .client.drawXY.drawY

pack .butleiste -side top
pack .butinit .butgo .butanimate .butsichern .exit \
           -in .butleiste -side left -padx 1m -pady 1m -fill x
pack .out -side top -expand yes -fill both
pack .out.text.scy -side right -fill y
pack .out.text.scx -side bottom -fill x
pack $AusgabeFenster -expand yes -fill both

pack .client -side bottom -fill both -expand yes
pack .client.drawZ -side bottom -fill both -expand yes
pack .client.drawXY -side bottom -fill both -expand yes
pack .client.drawXY.drawX -side left -fill both -expand yes
pack .client.drawXY.drawY -side right -fill both -expand yes
