From: Keith Seitz <keiths@cygnus.com>
To: Insight Maling List <insight@sources.redhat.com>
Subject: [PATCH] Remove tix from stackwin
Date: Tue, 21 Aug 2001 06:52:00 -0000 [thread overview]
Message-ID: <Pine.GSO.4.33.0108201212230.13816-100000@makita.cygnus.com> (raw)
Another one bites the dust...
Keith
ChangeLog
2001-08-20 Keith Seitz <keiths@redhat.com>
* library/stackwin.itb (build_win): Use iwidget's scrolled listbox
instead of tix scrolled list box.
(update): Update to use iwidget's scrolled list box.
(change_frame): Ditto.
Remove parameters.
* library/stackwin.ith (change_frame): Remove all parameters.
Patch
Index: stackwin.ith
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/stackwin.ith,v
retrieving revision 1.4
diff -u -p -r1.4 stackwin.ith
--- stackwin.ith 2001/06/04 15:49:53 1.4
+++ stackwin.ith 2001/08/20 19:11:49
@@ -25,7 +25,7 @@ class StackWin {
variable protect_me 0
method build_win {}
method cursor {glyph}
- method change_frame {y}
+ method change_frame {}
method no_inferior {}
}
Index: stackwin.itb
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/stackwin.itb,v
retrieving revision 1.4
diff -u -p -r1.4 stackwin.itb
--- stackwin.itb 2001/06/04 15:49:53 1.4
+++ stackwin.itb 2001/08/20 19:11:49
@@ -34,24 +34,26 @@ body StackWin::destructor {} {
# METHOD: build_win - build the main register window
# ------------------------------------------------------------------
body StackWin::build_win {} {
- global tixOption tcl_platform
- if {$tcl_platform(platform) == "windows"} {
- tixScrolledListBox $itk_interior.s -scrollbar both -sizebox 1
- } else {
- tixScrolledListBox $itk_interior.s -scrollbar auto
+ global tcl_platform
+
+ itk_component add slb {
+ iwidgets::scrolledlistbox $itk_interior.s \
+ -vscrollmode dynamic -hscrollmode dynamic \
+ -selectmode single -selectforeground black \
+ -selectbackground [pref get gdb/src/STACK_TAG] -exportselection false \
+ -textbackground [pref get gdb/font/normal_bg] \
+ -foreground [pref get gdb/font/normal_fg] \
+ -visibleitems 30x15 \
+ -textfont src-font -selectioncommand [code $this change_frame]
+ } {}
+
+ # Add sizebox for windows
+ if {[string compare $tcl_platform(platform) "windows"] == 0} {
+ ide_sizebox $itk_interior.sbox
+ place $itk_interior.sbox -relx 1.0 -rely 1.0 -anchor se
}
- set lb [$itk_interior.s subwidget listbox]
- $lb configure -selectmode single -bg $tixOption(input1_bg) \
- -selectbackground [pref get gdb/src/STACK_TAG] \
- -selectforeground black \
- -font src-font \
- -exportselection false
- update dummy
- $lb configure -width $maxwidth
- # bind mouse button 1 to change the stack frame
- bind $lb <ButtonPress-1> [code $this change_frame %y]
- bind $lb <ButtonRelease-1> break
+ update dummy
pack $itk_interior.s -side left -expand yes -fill both
@@ -66,8 +68,6 @@ body StackWin::update {event} {
global gdb_selected_frame_level
if {!$protect_me} {
- set lb [$itk_interior.s subwidget listbox]
-
# The gdb_stack command might fail, for instance if you are browsing
# a trace experiment, and the stack has not been collected.
@@ -77,12 +77,12 @@ body StackWin::update {event} {
}
if {[llength $frames] == 0} {
- $lb delete 0 end
- $lb insert end {NO STACK}
+ $itk_component(slb) delete 0 end
+ $itk_component(slb) insert end {NO STACK}
return
}
- $lb delete 0 end
+ $itk_component(slb) delete 0 end
set levels 0
foreach frame $frames {
set len [string length $frame]
@@ -90,7 +90,7 @@ body StackWin::update {event} {
if {$len > $maxwidth} {
set maxwidth $len
}
- $lb insert end $frame
+ $itk_component(slb) insert end $frame
incr levels
}
@@ -98,8 +98,8 @@ body StackWin::update {event} {
# window is looking at some location other than the
# bottom of the stack. If so, highlight the stack frame
set level [expr {$levels - $gdb_selected_frame_level - 1}]
- $lb selection set $level
- $lb see $level
+ $itk_component(slb) selection set $level
+ $itk_component(slb) see $level
}
}
@@ -112,16 +112,14 @@ body StackWin::idle {event} {
# METHOD: change_frame - change the current frame
# This body StackWin::is currently ONLY called from the mouse binding
# ------------------------------------------------------------------
-body StackWin::change_frame {y} {
- set lb [$itk_interior.s subwidget listbox]
+body StackWin::change_frame {} {
- if {!$Running && [$lb size] != 0} {
+ if {!$Running && [$itk_component(slb) size] != 0} {
gdbtk_busy
- set lb [$itk_interior.s subwidget listbox]
- set linenum [$lb nearest $y]
- set size [$lb size]
- set linenum [expr {$size - $linenum - 1}]
- catch {gdb_cmd "frame $linenum"}
+ set sel [$itk_component(slb) curselection]
+ set size [$itk_component(slb) size]
+ set frame_num [expr {$size - $sel - 1}]
+ catch {gdb_cmd "frame $frame_num"}
# Run idle hooks and cause all widgets to update
set protect_me 1
reply other threads:[~2001-08-21 6:52 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Pine.GSO.4.33.0108201212230.13816-100000@makita.cygnus.com \
--to=keiths@cygnus.com \
--cc=insight@sources.redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).