From mboxrd@z Thu Jan 1 00:00:00 1970 From: Keith Seitz To: Insight Maling List Subject: [PATCH] Remove tix from stackwin Date: Tue, 21 Aug 2001 06:52:00 -0000 Message-id: X-SW-Source: 2001-q3/msg00161.html Another one bites the dust... Keith ChangeLog 2001-08-20 Keith Seitz * 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 [code $this change_frame %y] - bind $lb 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