/usr/share/tkgate/scripts/wizard.tcl is in tkgate-data 2.0~b10-4.
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 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 | # Copyright (C) 1987-2004 by Jeffery P. Hansen
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# Last edit by hansen on Sat Jul 31 15:13:16 2004
#
#
# If we run this file standalone, enter test mode.
#
if {![info exists tkg_progName]} {
set wizard_test 1
source "misc.tcl"
source "dropbox.tcl"
} else {
set wizard_test 0
}
namespace eval Wizard {
variable props
proc buttons {w n1 s1 n2 s2} {
$w.bb.back configure -text $n1 -state $s1
$w.bb.next configure -text $n2 -state $s2
}
##############################################################################
#
# Generic function for setting the current page in a sequence box
#
proc setpage {w page} {
variable props
set props($w:current) $page
if { $props($w:current) == "finish" } {
destroy $w
frame $w
pack $w
frame $w.h -width [lindex $props($w:size) 0] -height 0
frame $w.v -width 0 -height [lindex $props($w:size) 1]
pack $w.h
pack $w.v -side left
$props($w:finish) $w 1
return
}
focus $w.bb.next
catch { destroy $w.f.p }
frame $w.f.p
$props($w:command) $w $w.f.p $props($w:current)
pack $w.f.p -fill both -expand 1
}
##############################################################################
#
# Advance to the next page in a sequence
#
proc next {w} {
variable props
$props($w:command) $w $w.f.p $props($w:current)+
}
##############################################################################
#
# Go back a page in a sequence
#
proc back {w} {
variable props
$props($w:command) $w $w.f.p $props($w:current)-
}
proc cancel {w} {
destroy .
}
proc create {w args} {
variable props
set width 400
set height 300
set bd 0
set relief flat
set command ""
set finishcommand ""
set cancelname Cancel
parseargs $args {-width -height -bd -relief -command -finishcommand }
set props($w:current) first
set props($w:command) $command
set props($w:finish) $finishcommand
set props($w:size) [list $width $height]
frame $w -bd $bd -relief $relief
frame $w.h -width $width -height 0
frame $w.v -height $height -width 0
frame $w.x -height 4 -width [expr $width - 20] -bd 2 -relief sunken
pack $w.h -side top
pack $w.v -side left
frame $w.f
frame $w.bb
pack $w.f -fill both -expand 1
pack $w.x -pady 5
pack $w.bb -fill x
button $w.bb.back -text "<Back" -command "Wizard::back $w"
button $w.bb.next -text "Next>" -command "Wizard::next $w"
button $w.bb.cancel -text "Cancel" -command "$Wizard::props($w:finish) $w 0"
pack $w.bb.cancel $w.bb.next $w.bb.back -side right -anchor e -padx 5 -pady 5
bind $w.bb.back <Return> "Wizard::back $w"
bind $w.bb.next <Return> "Wizard::next $w"
bind $w.bb.cancel <Return> "Wizard::cancel $w"
Wizard::setpage $w start+
}
proc testpager {rw w page} {
switch $page {
start+ {
Wizard::setpage $rw Fee
}
Fee {
Wizard::buttons $rw "<Back" disabled "Next>" normal
label $w.l -text Fee
pack $w.l
}
Fee+ {
Wizard::setpage $rw Fei
}
Fei {
Wizard::buttons $rw "<Back" normal "Next>" normal
label $w.l -text Fei
pack $w.l
}
Fei+ {
Wizard::setpage $rw Foe
}
Fei- {
Wizard::setpage $rw Fee
}
Foe {
Wizard::buttons $rw "<Back" normal "Next>" normal
label $w.l -text Foe
pack $w.l
}
Foe+ {
Wizard::setpage $rw Fum
}
Foe- {
Wizard::setpage $rw Fei
}
Fum {
Wizard::buttons $rw "<Back" normal "Finish" normal
label $w.l -text Fum
pack $w.l
}
Fum+ {
Wizard::setpage $rw finish
}
Fum- {
Wizard::setpage $rw Foe
}
}
}
proc testdone {w isok} {
puts "testdone $w"
destroy .
}
#
# Test the wizard widget
#
proc tester {} {
Wizard::create .seq -width 650 -height 525 -bd 2 -relief raised -command Wizard::testpager -finishcommand Wizard::testdone
pack .seq
}
}
if { $wizard_test } {
Wizard::tester
}
|