|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc RunSample {w} { |
|
global demo_dir |
|
|
|
|
|
|
|
|
|
frame $w.top |
|
|
|
|
|
|
|
|
|
|
|
tixSelect $w.top.just -allowzero false -radio true \ |
|
-label "Justification: "\ |
|
-options { |
|
label.width 15 |
|
label.padx 4 |
|
label.anchor e |
|
} |
|
|
|
|
|
|
|
|
|
|
|
tixSelect $w.top.font -allowzero true -radio false \ |
|
-label "Font: " \ |
|
-options { |
|
label.width 15 |
|
label.padx 4 |
|
label.anchor e |
|
} |
|
|
|
pack $w.top.just $w.top.font -side top -expand yes -anchor c \ |
|
-padx 4 -pady 4 |
|
|
|
|
|
|
|
|
|
$w.top.font add bold -bitmap @$demo_dir/bitmaps/bold.xbm |
|
$w.top.font add italic -bitmap @$demo_dir/bitmaps/italic.xbm |
|
$w.top.font add underline -bitmap @$demo_dir/bitmaps/underlin.xbm |
|
$w.top.font add capital -bitmap @$demo_dir/bitmaps/capital.xbm |
|
|
|
|
|
|
|
|
|
$w.top.just add left -bitmap @$demo_dir/bitmaps/leftj.xbm |
|
$w.top.just add right -bitmap @$demo_dir/bitmaps/rightj.xbm |
|
$w.top.just add center -bitmap @$demo_dir/bitmaps/centerj.xbm |
|
$w.top.just add justified -bitmap @$demo_dir/bitmaps/justify.xbm |
|
|
|
$w.top.font config -variable sel_font |
|
$w.top.just config -variable sel_just |
|
|
|
|
|
|
|
|
|
global sel_just sel_font |
|
set sel_just justified |
|
set sel_font {bold underline} |
|
|
|
|
|
|
|
tixButtonBox $w.box -orientation horizontal |
|
$w.box add ok -text Ok -underline 0 -width 6\ |
|
-command "sel:cmd $w; destroy $w" |
|
|
|
$w.box add apply -text Apply -underline 0 -width 6\ |
|
-command "sel:cmd $w" |
|
|
|
$w.box add cancel -text Cancel -underline 0 -width 6\ |
|
-command "destroy $w" |
|
|
|
pack $w.box -side bottom -fill x |
|
pack $w.top -side top -fill both -expand yes |
|
} |
|
|
|
|
|
|
|
|
|
proc sel:cmd {w} { |
|
global sel_font sel_just |
|
|
|
tixDemo:Status "The justification is $sel_just" |
|
|
|
if {$sel_font == {}} { |
|
tixDemo:Status "The font is normal" |
|
} else { |
|
tixDemo:Status "The font is $sel_font" |
|
} |
|
|
|
} |
|
|
|
if {![info exists tix_demo_running]} { |
|
wm withdraw . |
|
set w .demo |
|
toplevel $w; wm transient $w "" |
|
RunSample $w |
|
bind .demo <Destroy> exit |
|
} |
|
|