|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
proc RunSample {w} { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
frame $w.top -border 1 -relief raised |
|
|
|
tixHList $w.top.h -yscrollcommand "$w.top.s set" -separator / \ |
|
-browsecmd "hlist1:browse $w.top.h" \ |
|
-command "hlist1:activate $w.top.h"\ |
|
-wideselection false \ |
|
-indent 15 |
|
scrollbar $w.top.s -command "$w.top.h yview" -takefocus 0 |
|
|
|
|
|
|
|
global folder1 folder2 |
|
set img1 [image create bitmap -data $folder1] |
|
set img2 [image create bitmap -data $folder2] |
|
|
|
|
|
|
|
set h $w.top.h |
|
set dirs { |
|
/ |
|
/lib |
|
/pkg |
|
/usr |
|
/usr/lib |
|
/usr/local |
|
/usr/local/lib |
|
/pkg/lib |
|
} |
|
foreach d $dirs { |
|
$h add $d -itemtype imagetext -text $d -image $img2 -data $d |
|
|
|
|
|
|
|
if {![string match "*lib" $d]} { |
|
$h entryconfig $d -state disabled -image $img1 |
|
} |
|
} |
|
|
|
|
|
|
|
|
|
|
|
tixLabelEntry $w.top.e -label "Installation Directory:" -labelside top \ |
|
-options { |
|
entry.width 25 |
|
entry.textVariable demo_hlist_dir |
|
label.anchor w |
|
} |
|
bind [$w.top.e subwidget entry] <Return> "hlist:okcmd $w" |
|
|
|
|
|
|
|
uplevel #0 set demo_hlist_dir /usr/local/lib |
|
$h anchor set /usr/local/lib |
|
$h select set /usr/local/lib |
|
|
|
pack $w.top.h -side left -expand yes -fill both -padx 2 -pady 2 |
|
pack $w.top.s -side left -fill y -pady 2 |
|
pack $w.top.e -side left -expand yes -fill x -anchor s -padx 4 -pady 2 |
|
|
|
|
|
|
|
tixButtonBox $w.box -orientation horizontal |
|
$w.box add ok -text Ok -underline 0 -command "hlist:okcmd $w" \ |
|
-width 6 |
|
$w.box add cancel -text Cancel -underline 0 -command "destroy $w" \ |
|
-width 6 |
|
|
|
pack $w.box -side bottom -fill x |
|
pack $w.top -side top -fill both -expand yes |
|
} |
|
|
|
|
|
|
|
|
|
|
|
proc hlist1:browse {w dir} { |
|
global demo_hlist_dir |
|
|
|
set demo_hlist_dir [$w entrycget $dir -data] |
|
} |
|
|
|
|
|
|
|
|
|
proc hlist1:activate {w dir} { |
|
global demo_hlist_dir |
|
|
|
set demo_hlist_dir [$w entrycget $dir -data] |
|
tixDemo:Status "You have selected the directory $demo_hlist_dir" |
|
|
|
destroy [winfo toplevel $w] |
|
} |
|
|
|
proc hlist:okcmd {w} { |
|
global demo_hlist_dir |
|
|
|
tixDemo:Status "You have selected the directory $demo_hlist_dir" |
|
|
|
destroy $w |
|
} |
|
|
|
set folder1 { |
|
|
|
|
|
static unsigned char foo_bits[] = { |
|
0x00, 0x00, 0x00, 0x3e, 0xfe, 0x41, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, |
|
0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0x02, 0x40, 0xfe, 0x7f, 0x00, 0x00};} |
|
|
|
set folder2 { |
|
|
|
|
|
static unsigned char foo_bits[] = { |
|
0x00, 0x00, 0x00, 0x00, 0xfe, 0x7f, 0x02, 0x40, 0x02, 0x44, 0xf2, 0x4f, |
|
0xf2, 0x5f, 0xf2, 0x4f, 0x02, 0x44, 0x02, 0x40, 0xfe, 0x7f, 0x00, 0x00}; |
|
} |
|
|
|
|
|
|
|
|
|
if {![info exists tix_demo_running]} { |
|
wm withdraw . |
|
set w .demo |
|
toplevel $w; wm transient $w "" |
|
RunSample $w |
|
bind $w <Destroy> exit |
|
} |
|
|
|
|