Esqueleto de aplicación
#!/bin/sh
# the next line restarts using wish
exec wish "$0" "$@"
package require BLT
namespace eval Interface {
proc init {} {
#**** Ventana *******************************************************
wm title . "Aplicación de prueba"
. configure -width 800 -height 600 -menu [menu .mnu]
#**** Menu **********************************************************
menu .mnu.archivo
.mnu add cascade -menu .mnu.archivo -label "Archivo"
.mnu.archivo add command -label "Abrir" -command {::Funciones::abrir}
.mnu.archivo add separator
.mnu.archivo add command -label "Salir" -command {exit}
menu .mnu.ayuda
.mnu add cascade -menu .mnu.ayuda -label "Ayuda"
.mnu.ayuda add command -label "Ayuda"
.mnu.ayuda add command -label "Acerca de esta prueba" -command {::Funciones::acerca}
frame .frametxt
text .frametxt.txt -height 40 -width 80 -yscrollcommand {.frametxt.scroll set}
scrollbar .frametxt.scroll -command {.frametxt.text yview} -orient v
pack .frametxt.txt -fill both -expand 1 -side left
pack .frametxt.scroll -expand 1 -fill y
}
}
namespace eval Funciones {
proc abrir {} {
puts "Abrir: no implemntado"
}
proc acerca {} {
set txt {Aplicación de prueba}
append txt {Version 1.0}
tk_messageBox -message $txt -type ok -title "Acerca de esta prueba"
}
}
::Interface::init