* nindy-share/nindy.c (say): Use stdarg.h macros when compiling
with an ANSI compiler.
+start-sanitize-gdbtk
+Tue Feb 6 16:31:25 1996 Tom Tromey <tromey@creche.cygnus.com>
+
+ * gdbtk.tcl (create_file_win): Eliminate text widget B1 binding so
+ double-clicking will work again.
+ (create_asm_win): Put "break" at end of all B1 bindings.
+ (create_file_win): Lower "sel" tag, don't raise it.
+ (ensure_line_visible): New proc.
+ (update_listing, update_assembly): Use it.
+ (create_copyright_window): Destroy window on Leave event.
+ (create_command_window): Put "break" at end of all B2 bindings.
+
+end-sanitize-gdbtk
Mon Feb 5 18:24:28 1996 Steve Chamberlain <sac@slash.cygnus.com>
From Michael_Snyder@NeXT.COM (Michael Snyder):
bindtags $widget $newList
}
+#
+# Make sure line number $LINE is visible in the text widget. But be
+# more clever than the "see" command: if LINE is not currently
+# displayed, arrange for LINE to be centered. There are cases in
+# which this does not work, so as a last resort we revert to "see".
+#
+# This is inefficient, but probably not slow enough to actually
+# notice.
+#
+proc ensure_line_visible {text line} {
+ set pixHeight [winfo height $text]
+ # Compute height of widget in lines. This fails if a line is wider
+ # than the screen. FIXME.
+ set topLine [lindex [split [$text index @0,0] .] 0]
+ set botLine [lindex [split [$text index @0,${pixHeight}] .] 0]
+
+ if {$line > $topLine && $line < $botLine} then {
+ # Onscreen, and not on the very edge.
+ return
+ }
+
+ set newTop [expr {$line - ($botLine - $topLine)}]
+ if {$newTop < 0} then {
+ set newTop 0
+ }
+ $text yview moveto $newTop
+
+ # In case the above failed.
+ $text see ${line}.0
+}
+
if {[info exists env(EDITOR)]} then {
set editor $env(EDITOR)
} else {
%W tag remove sel $last end
%W tag add sel anchor @%x,%y
}
- $win tag bind sel <1> do_nothing
- $win tag bind sel <Double-Button-1> {display_expression [selection get]}
- $win tag raise sel
+ $win tag bind sel <1> break
+ $win tag bind sel <Double-Button-1> {
+ display_expression [selection get]
+ break
+ }
+ $win tag bind sel <B1-Motion> break
+ $win tag lower sel
+ # Make these bindings do nothing on the text window -- they
+ # are completely handled by the tag bindings above.
+ bind $win <1> break
+ bind $win <B1-Motion> break
+ bind $win <Double-Button-1> break
# Scan though the breakpoint data base and install any destined for this file
# Setup all the bindings
bind $win <Enter> {focus %W}
- bind $win <1> {asm_window_button_1 %W %X %Y %x %y}
- bind $win <B1-Motion> do_nothing
+ bind $win <1> {asm_window_button_1 %W %X %Y %x %y; break}
+ bind $win <B1-Motion> break
+ bind $win <Double-Button-1> break
bind $win <Key-Alt_R> do_nothing
bind $win <Key-Alt_L> do_nothing
.src.scroll configure -command "$wins($cfile) yview"
- $wins($cfile) see "${line}.0 linestart"
+ # $wins($cfile) see "${line}.0 linestart"
+ ensure_line_visible $wins($cfile) $line
}
# Update the label widget in case the filename or function name has changed
$wins($cfile) delete $pointer_pos "$pointer_pos + 2 char"
$wins($cfile) insert $pointer_pos "->"
- $wins($cfile) see "${line}.0 linestart"
+ ensure_line_visible $wins($cfile) $line
$wins($cfile) configure -state disabled
}
}
-after .asm.scroll
.asm.scroll configure -command "$win yview"
set line [pc_to_line $pclist($cfunc) $pc]
- $win see "${line}.0 linestart"
+ ensure_line_visible $win $line
update
}
$win delete $pointer_pos "$pointer_pos + 2 char"
$win insert $pointer_pos "->"
- $win yview "${line}.0 linestart"
+ ensure_line_visible $win $line
$win configure -state disabled
}
}
append command_line [selection get]
break
}
+ bind .cmd.text <B2-Motion> break
+ bind .cmd.text <ButtonRelease-2> break
bind .cmd.text <Key-Tab> {
set choices [gdb_cmd "complete $command_line"]
set choices [string trimright $choices \n]
pack .c.m
bind .c.m <1> {destroy .c}
+ bind .c <Leave> {destroy .c}
# "suitable period" currently means "15 seconds".
after 15000 {
if {[winfo exists .c]} then {