2 # based on code from gitk, Copyright (C) Paul Mackerras
11 constructor new {i_w i_text args} {
17 ${NS}::label $w.l -text [mc "Goto Line:"]
19 -textvariable ${__this}::linenum \
20 -background lightgreen \
22 -validatecommand [cb _validate %P]
23 ${NS}::button $w.bn -text [mc Go] -command [cb _goto]
26 pack $w.bn -side right
27 pack $w.ent -side left -expand 1 -fill x
29 eval grid conf $w -sticky we $args
32 trace add variable linenum write [cb _goto_cb]
33 bind $w.ent <Return> [cb _goto]
34 bind $w.ent <Escape> [cb hide]
36 bind $w <Destroy> [list delete_this $this]
41 if {![visible $this]} {
48 if {[visible $this]} {
56 return [winfo ismapped $w]
63 method _validate {P} {
64 # only accept numbers as input
68 method _goto_cb {name ix op} {
69 after idle [cb _goto 1]
72 method _goto {{nohide {0}}} {