Tcl-Tk-Tkwidget-Tix
view release on metacpan or search on metacpan
demos/tixwidgets.tcl view on Meta::CPAN
set w [frame $top.f3 -relief raised -bd 1]
set demo(statusbar) \
[label $w.status -relief sunken -bd 1]
tixForm $demo(statusbar) -padx 3 -pady 3 -left 0 -right %70
$w.status configure -text [file native $demo_dir]
return $w
}
proc tixDemo:Status {msg} {
global demo
$demo(statusbar) configure -text $msg
}
proc tixDemo:MkWelcome {nb page} {
set w [$nb subwidget $page]
set bar [tixDemo:MkWelcomeBar $w]
set text [tixDemo:MkWelcomeText $w]
pack $bar -side top -fill x -padx 2 -pady 2
pack $text -side top -fill both -expand yes
}
proc tixDemo:MkWelcomeBar {top} {
global demo
set w [frame $top.bar -bd 2 -relief groove]
# Create and configure comboBox 1
#
tixComboBox $w.cbx1 -command [list tixDemo:MainTextFont $top] \
-options {
entry.width 15
listbox.height 3
}
tixComboBox $w.cbx2 -command [list tixDemo:MainTextFont $top] \
-options {
entry.width 4
listbox.height 3
}
set demo(welfont) $w.cbx1
set demo(welsize) $w.cbx2
$w.cbx1 insert end "Courier"
$w.cbx1 insert end "Helvetica"
$w.cbx1 insert end "Lucida"
$w.cbx1 insert end "Times Roman"
$w.cbx2 insert end 8
$w.cbx2 insert end 10
$w.cbx2 insert end 12
$w.cbx2 insert end 14
$w.cbx2 insert end 18
$w.cbx1 pick 1
$w.cbx2 pick 3
# Pack the comboboxes together
#
pack $w.cbx1 $w.cbx2 -side left -padx 4 -pady 4
$demo(balloon) bind $w.cbx1\
-msg "Choose\na font" -statusmsg "Choose a font for this page"
$demo(balloon) bind $w.cbx2\
-msg "Point size" -statusmsg "Choose the font size for this page"
tixDoWhenIdle tixDemo:MainTextFont $top
return $w
}
proc tixDemo:MkWelcomeText {top} {
global demo tix_version
set w [tixScrolledWindow $top.f3 -scrollbar auto]
set win [$w subwidget window]
label $win.title -font [list times -18 bold] \
-bd 0 -width 30 -anchor n\
-text "Welcome to TIX version $tix_version"
message $win.msg -font [list helvetica -14 bold] \
-bd 0 -width 400 -anchor n\
-text "\
Tix $tix_version is a library of mega-widgets based on TK. This program \
demonstrates the widgets in the Tix widget. You can choose the pages \
in this window to look at the corresponding widgets. \
To quit this program, choose the \"File | Exit\" command."
pack $win.title -expand yes -fill both -padx 10 -pady 10
pack $win.msg -expand yes -fill both -padx 10 -pady 10
set demo(welmsg) $win.msg
return $w
}
proc tixDemo:MainTextFont {w args} {
global demo
if {![info exists demo(welmsg)]} {
return
}
set font [$demo(welfont) cget -value]
set point [$demo(welsize) cget -value]
case $font {
"Courier" {
set f courier
}
"Helvetica" {
set f helvetica
}
"Lucida" {
set f lucida
}
default {
set f times
( run in 0.640 second using v1.01-cache-2.11-cpan-364913b4093 )