#!/usr/bin/wish -f
# menu.tcl --
#
# This demonstration script creates a window with a bunch of menus
# and cascaded menus using menubars.
#
# RCS: @(#) $Id: menu.tcl,v 1.2 1998/09/14 18:23:29 stanton Exp $

set font "Arial"

set w .menu
catch {destroy $w}
toplevel $w
wm title $w "Latein lernen"
wm iconname $w "menu"
# positionWindow $w

label $w.question -font $font -wraplength 4i -justify center -width 50 -height 10
$w.question configure -text "Frage" -background "yellow" -foreground "red"
label $w.answer -font $font -wraplength 4i -justify center  -width 50 -height 10
$w.answer configure -text "Antwort" -foreground "yellow" -background "orange"

pack $w.question -side top
pack $w.answer -side bottom

set menustatus "    "
frame $w.statusBar
label $w.statusBar.label -background "green" -foreground "orangered" -textvariable menustatus -relief sunken -bd 1 -font "Helvetica 10" -anchor w
label $w.statusBar.counter -foreground "blue" -background "orange" -textvariable counter -relief raised -bd 1 -font "Helvetica 10" -anchor e
pack $w.statusBar.label -side left -padx 2 -expand yes -fill both
pack $w.statusBar.counter -side right -padx 2 -expand no -fill both
pack $w.statusBar -side bottom -fill x -pady 2

frame $w.buttons -background "ghostwhite"
pack $w.buttons -side bottom -fill x -pady 2m
button $w.buttons.gewusst -text "Gewusst!" -command "gewusst" -background "orangered"
button $w.buttons.verloren -text "Verloren!" -command "verloren" -background "#FF6733"
pack $w.buttons.gewusst $w.buttons.verloren -side right -expand 1

menu $w.menu -tearoff 0 -background "#FF8800" -foreground "orangered"

set m $w.menu.file
menu $m -tearoff 0
$w.menu add cascade -label "Latein" -menu $m -underline 0
$m add command -label "ffnen ..." -command datei_oeffnen
$m add separator
$m add command -label "beenden ..." -command exit

$w configure -menu $w.menu -background "orangered"

bind Menu <<MenuSelect>> {
    global $menustatus
    if {[catch {%W entrycget active -label} label]} {
	set label "    "
    }
    set menustatus $label
    set counter "Hallo"
    # pack $w.statusBar.counter
    update idletasks
}


