/usr/share/doc/tix/examples/MkScroll.tcl is in tix-dev 8.4.3-10.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 | # -*-mode: tcl; fill-column: 75; tab-width: 8; coding: iso-latin-1-unix -*-
#
# $Id: MkScroll.tcl,v 1.3 2001/12/09 05:34:59 idiscovery Exp $
#
# MkScroll.tcl --
#
# This file implements the "Scrolled Widgets" page in the widget demo
#
# This file has not been properly documented. It is NOT intended
# to be used as an introductory demo program about Tix
# programming. For such demos, please see the files in the
# demos/samples directory or go to the "Samples" page in the
# "widget demo"
#
#
# Copyright (c) 1996, Expert Interface Technologies
#
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
proc MkScroll {nb page} {
set w [$nb subwidget $page]
set name [tixOptionName $w]
option add *$name*TixLabelFrame*label.padX 4
tixLabelFrame $w.sls -label "tixScrolledListBox"
tixLabelFrame $w.swn -label "tixScrolledWindow"
tixLabelFrame $w.stx -label "tixScrolledText"
MkSList [$w.sls subwidget frame]
MkSText [$w.stx subwidget frame]
MkSWindow [$w.swn subwidget frame]
tixForm $w.sls -top 0 -left 0 -right %33 -bottom -1
tixForm $w.swn -top 0 -left $w.sls -right %66 -bottom -1
tixForm $w.stx -top 0 -left $w.swn -right -1 -bottom -1
}
#----------------------------------------------------------------------
# ScrolledListBox
#----------------------------------------------------------------------
proc MkSList {w} {
frame $w.top -width 300 -height 330
frame $w.bot
message $w.top.msg \
-relief flat -width 200 -anchor n\
-text {This TixScrolledListBox is configured so that it uses\
scrollbars only when it is necessary. Use the handles to\
resize the listbox and watch the scrollbars automatically\
appear and disappear.}
set list [tixScrolledListBox $w.top.list -scrollbar auto]
place $list -x 50 -y 150 -width 120 -height 80
$list subwidget listbox insert end Alabama
$list subwidget listbox insert end California
$list subwidget listbox insert end Montana
$list subwidget listbox insert end "New Jersy"
$list subwidget listbox insert end "New York"
$list subwidget listbox insert end Pennsylvania
$list subwidget listbox insert end Washington
set rh [tixResizeHandle $w.top.r -relief raised \
-handlesize 8 -gridded true -minwidth 50 -minheight 30]
button $w.bot.btn -text Reset -command "SList:Reset $rh $list"
pack propagate $w.top 0
pack $w.top.msg -fill x
pack $w.bot.btn -anchor c
pack $w.top -expand yes -fill both
pack $w.bot -fill both
bind $list <Map> "tixDoWhenIdle $rh attachwidget $list"
}
proc SList:Reset {rh list} {
place $list -x 50 -y 150 -width 120 -height 80
update
$rh attachwidget $list
}
#----------------------------------------------------------------------
# ScrolledWindow
#----------------------------------------------------------------------
proc MkSWindow {w} {
global demo_dir
frame $w.top -width 330 -height 330
frame $w.bot
message $w.top.msg \
-relief flat -width 200 -anchor n\
-text {The TixScrolledWindow widget allows you\
to scroll any kind of TK widget. It is more versatile\
than a scrolled canvas widget}
set win [tixScrolledWindow $w.top.win -scrollbar auto]
set f [$win subwidget window]
set image [image create photo -file $demo_dir/bitmaps/tix.gif]
label $f.b1 -image $image
pack $f.b1 -expand yes -fill both
place $win -x 30 -y 150 -width 190 -height 120
set rh [tixResizeHandle $w.top.r -relief raised \
-handlesize 8 -gridded true -minwidth 50 -minheight 30]
button $w.bot.btn -text Reset -command "SWindow:Reset $rh $win"
pack propagate $w.top 0
pack $w.top.msg -fill x
pack $w.bot.btn -anchor c
pack $w.top -expand yes -fill both
pack $w.bot -fill both
bind $win <Map> "tixDoWhenIdle $rh attachwidget $win"
}
proc SWindow:Reset {rh win} {
place $win -x 30 -y 150 -width 190 -height 120
update
$rh attachwidget $win
}
#----------------------------------------------------------------------
# ScrolledText
#----------------------------------------------------------------------
proc MkSText {w} {
frame $w.top -width 330 -height 330
frame $w.bot
message $w.top.msg \
-relief flat -width 200 -anchor n\
-text {The TixScrolledWindow widget allows you\
to scroll any kind of TK widget. It is more versatile\
than a scrolled canvas widget}
set win [tixScrolledText $w.top.win -scrollbar both]
$win subwidget text config -wrap none
place $win -x 30 -y 150 -width 190 -height 100
set rh [tixResizeHandle $w.top.r -relief raised \
-handlesize 8 -gridded true -minwidth 50 -minheight 30]
button $w.bot.btn -text Reset -command "SText:Reset $rh $win"
pack propagate $w.top 0
pack $w.top.msg -fill x
pack $w.bot.btn -anchor c
pack $w.top -expand yes -fill both
pack $w.bot -fill both
bind $win <Map> "tixDoWhenIdle $rh attachwidget $win"
}
proc SText:Reset {rh win} {
place $win -x 30 -y 150 -width 190 -height 100
update
$rh attachwidget $win
}
|