/usr/share/tkgate-1.8.7/scripts/errbox.tcl is in tkgate-data 1.8.7-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 | # Copyright (C) 1987-2007 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 Fri Dec 5 12:31:19 2003
#
# This file contains procedures for displaying and maniuplating
# the error list. The error list is a box listing any errors that
# occured when starting the simulator. The user can click on an
# error messsage and cause the editor to jump to the location
# of the error.
#
# tkg_makeErrBox Pop up the error message box
# tkg_delErrBox Delete the error box
# tkg_errBoxAdd "error message" Add a message to the box
#
# tkg_errBoxReport Call back to report selection
# gat_errBoxReport C call back
#
set tkg_errBoxActive 0
proc tkg_errBoxReport {} {
action ShowErr {
gat_errBoxReport [.errbox.lframe.list curselection]
}
}
proc tkg_delErrBox {} {
global tkg_errBoxActive
set tkg_errBoxActive 0
transAction - {
gat_errBoxReport -1
}
destroy .errbox
}
proc tkg_errBoxUp {} {
if { [catch {set N [.errbox.lframe.list curselection]} ] } {
return
}
if { $N == "" } {
set N 0
} else {
set N [expr $N - 1]
}
.errbox.lframe.list selection clear 0 end
.errbox.lframe.list selection set $N
.errbox.lframe.list see $N
tkg_errBoxReport
}
proc tkg_errBoxDown {} {
if { [catch {set N [.errbox.lframe.list curselection]} ] } {
return
}
if { $N == "" } {
set N 0
} else {
set N [expr $N + 1]
}
.errbox.lframe.list selection clear 0 end
.errbox.lframe.list selection set $N
.errbox.lframe.list see $N
tkg_errBoxReport
}
proc tkg_makeErrBox {} {
global tkg_errBoxActive
toplevel .errbox
wm title .errbox "TKGate: Error List"
wm transient .errbox .
frame .errbox.lframe
listbox .errbox.lframe.list -width 60 -yscrollcommand ".errbox.lframe.vert set" -xscrollcommand ".errbox.lframe.horz set"
scrollbar .errbox.lframe.vert -command ".errbox.lframe.list yview"
scrollbar .errbox.lframe.horz -orient horizontal -command ".errbox.lframe.list xview"
grid rowconfigure .errbox.lframe 0 -weight 0
grid columnconfigure .errbox.lframe 0 -weight 0
grid .errbox.lframe.list -row 0 -column 0 -sticky nsew
grid .errbox.lframe.vert -row 0 -column 1 -sticky ns
grid .errbox.lframe.horz -row 1 -column 0 -sticky ew
pack .errbox.lframe -side top -padx 5 -pady 5 -fill both -expand 1
bind .errbox.lframe.list <ButtonRelease-1> { tkg_errBoxReport }
frame .errbox.dframe
button .errbox.dframe.dismiss -text [m b.dismiss] -command tkg_delErrBox
pack .errbox.dframe.dismiss -fill both -padx 5 -pady 5
pack .errbox.dframe -side bottom -padx 5 -pady 5
bind .errbox <Up> { act_errBoxUp }
bind .errbox <Down> { act_errBoxDown }
bind .errbox <p> { act_errBoxUp }
bind .errbox <n> { act_errBoxDown }
bind .errbox <Control-p> { act_errBoxUp }
bind .errbox <Control-n> { act_errBoxDown }
set tkg_errBoxActive 1
}
proc tkg_errBoxAdd args {
.errbox.lframe.list insert end [join $args ]
}
proc tkg_errBoxTestSetup {} {
global tkg_errBoxActive
if { $tkg_errBoxActive == 0 } {
tkg_makeErrBox
tkg_errBoxAdd "This is an error message of some length with an \"h\" in it."
tkg_errBoxAdd how
tkg_errBoxAdd are
tkg_errBoxAdd you
tkg_errBoxAdd world
}
}
proc tkg_errBoxTest {} {
button .open -text [m b.open] -command tkg_errBoxTestSetup
pack .open
}
|