This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[PATCH] tracedlg.tcl: remove tix, bugfix in actiondlg.tcl
- To: Insight Maling List <insight at sources dot redhat dot com>
- Subject: [PATCH] tracedlg.tcl: remove tix, bugfix in actiondlg.tcl
- From: Keith Seitz <keiths at cygnus dot com>
- Date: Tue, 28 Aug 2001 17:13:16 -0700 (PDT)
Hi,
[Apologies for sneaking in two patches in one submission]
Well, this is it! This is the last eradication of tix that can occur in
Insight before we need to drag in BLT or some way of doing the variable
windows. (I'm not counting the trivial occurance of tix in main.tcl.)
This patch removes tix from tracedlg.tcl (not that anyone has really used
that for a long, long time) and fixes a tiny bug in actiondlg.tcl that I
forgot about when I deprecated "gdb_regnames".
Keith
ChangeLog
2001-08-28 Keith Seitz <keiths@redhat.com>
* library/tracedlg.tcl (build_win): Use libgui's
Labelledframe instead of tixLabelFrame.
Use iwidgets::scrolledlistbox instead of tixScrolledListbox.
(edit): Check if there is a selection in the listbox before
proceeding.
Escape method callbacks before passing to ActionDlg.
* library/actiondlg.tcl (constructor): Use "gdb_reginfo"
Patch
Index: library/actiondlg.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/actiondlg.tcl,v
retrieving revision 1.3
diff -u -p -r1.3 actiondlg.tcl
--- actiondlg.tcl 2001/07/12 23:15:56 1.3
+++ actiondlg.tcl 2001/08/29 00:03:39
@@ -23,7 +23,7 @@ class ActionDlg {
eval itk_initialize $args
- set Registers [gdb_regnames]
+ set Registers [gdb_reginfo name]
if {$Line != ""} {
set Locals [gdb_get_locals "$File:$Line"]
set Args [gdb_get_args "$File:$Line"]
Index: library/tracedlg.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/tracedlg.tcl,v
retrieving revision 1.2
diff -u -p -r1.2 tracedlg.tcl
--- tracedlg.tcl 2001/07/12 23:10:54 1.2
+++ tracedlg.tcl 2001/08/29 00:05:03
@@ -178,10 +178,10 @@ class TraceDlg {
# The three frames of this dialog
set bbox [frame $f.bbox]; # for holding OK,CANCEL DELETE buttons
- tixLabelFrame $f.exp -label "Experiment"
- set exp [$f.exp subwidget frame]; # the "Experiment" frame
- tixLabelFrame $f.act -label "Actions"
- set act [$f.act subwidget frame]; # the "Actions" frame
+ Labelledframe $f.exp -text "Experiment"
+ set exp [$f.exp get_frame]; # the "Experiment" frame
+ Labelledframe $f.act -text "Actions"
+ set act [$f.act get_frame]; # the "Actions" frame
# Setup the button box
button $bbox.ok -text OK -command "$this ok" -width 6
@@ -301,14 +301,17 @@ class TraceDlg {
pack $pass_frame.ent -side right -padx 10 -pady 5
# Actions
- tixScrolledListBox $act_frame.lb -scrollbar auto
- set ActionLB [$act_frame.lb subwidget listbox]
- $ActionLB configure -selectmode multiple -exportselection 0
+ #tixScrolledListBox $act_frame.lb -scrollbar auto
+ set ActionLB $act_frame.lb
+ iwidgets::scrolledlistbox $act_frame.lb -hscrollmode dynamic \
+ -vscrollmode dynamic -selectmode multiple -exportselection 0 \
+ -dblclickcommand [code $this edit] \
+ -selectioncommand [code $this set_delete_action_state $ActionLB $new_frame.del_but] \
+ -background [pref get gdb/font/normal_bg]
+ [$ActionLB component listbox] configure -background [pref get gdb/font/normal_bg]
label $act_frame.lbl -text {Actions}
pack $act_frame.lbl -side top
pack $act_frame.lb -side bottom -fill both -expand 1 -padx 5 -pady 5
- $act_frame.lb configure -command "$this edit" \
- -browsecmd "$this set_delete_action_state $ActionLB $new_frame.del_but"
# New actions
combobox::combobox $new_frame.combo -maxheight 15 -editable 0 -font src-font \
@@ -621,48 +624,50 @@ class TraceDlg {
method edit {} {
set Selection [$ActionLB curselection]
- set action [$ActionLB get $Selection]
- if [regexp "collect" $action] {
- scan $action "collect: %s" data
- set steps 0
- set whilestepping 0
- } elseif [regexp "while-stepping" $action] {
- scan $action "while-stepping (%d): %s" steps data
- set whilestepping 1
- } else {
- debug "unknown action: $action"
- return
- }
+ if {$Selection != ""} {
+ set action [$ActionLB get $Selection]
+ if [regexp "collect" $action] {
+ scan $action "collect: %s" data
+ set steps 0
+ set whilestepping 0
+ } elseif [regexp "while-stepping" $action] {
+ scan $action "while-stepping (%d): %s" steps data
+ set whilestepping 1
+ } else {
+ debug "unknown action: $action"
+ return
+ }
- set data [split $data ,]
- set len [llength $data]
- set real_data {}
- set special 0
- for {set i 0} {$i < $len} {incr i} {
- set a [lindex $data $i]
- if {[string range $a 0 1] == "\$("} {
- set special 1
- set b $a
- } elseif {$special} {
- lappend b $a
- if {[string index $a [expr {[string length $a]-1}]] == ")"} {
- lappend real_data [join $b ,]
- set special 0
+ set data [split $data ,]
+ set len [llength $data]
+ set real_data {}
+ set special 0
+ for {set i 0} {$i < $len} {incr i} {
+ set a [lindex $data $i]
+ if {[string range $a 0 1] == "\$("} {
+ set special 1
+ set b $a
+ } elseif {$special} {
+ lappend b $a
+ if {[string index $a [expr {[string length $a]-1}]] == ")"} {
+ lappend real_data [join $b ,]
+ set special 0
+ }
+ } else {
+ lappend real_data $a
}
+ }
+
+ # !! lindex $Lines 0 -- better way?
+ if {$Lines != {}} {
+ ManagedWin::open ActionDlg -File $File -Line [lindex $Lines 0] \
+ -WhileStepping $whilestepping -Number [lindex $Number 0] \
+ -Callback [list [code $this done]] -Data $real_data -Steps $steps
} else {
- lappend real_data $a
+ ManagedWin::open ActionDlg -File $File -Address [lindex $Addresses 0] \
+ -WhileStepping $whilestepping -Number [lindex $Number 0] \
+ -Callback [list [code $this done]] -Data $real_data -Steps $steps
}
- }
-
- # !! lindex $Lines 0 -- better way?
- if {$Lines != {}} {
- ManagedWin::open ActionDlg -File $File -Line [lindex $Lines 0] \
- -WhileStepping $whilestepping -Number [lindex $Number 0] \
- -Callback "$this done" -Data $real_data -Steps $steps
- } else {
- ManagedWin::open ActionDlg -File $File -Address [lindex $Addresses 0] \
- -WhileStepping $whilestepping -Number [lindex $Number 0] \
- -Callback "$this done" -Data $real_data -Steps $steps
}
}