This is the mail archive of the
insight@sources.redhat.com
mailing list for the Insight project.
[PATCH] Update tdump.tcl and whack tix
- To: Insight Maling List <insight at sources dot redhat dot com>
- Subject: [PATCH] Update tdump.tcl and whack tix
- From: Keith Seitz <keiths at cygnus dot com>
- Date: Tue, 28 Aug 2001 16:37:34 -0700 (PDT)
Hi,
Ok, the tracing stuff isn't used altogether too much (why?), but here's a
small update of the Trace Dump window to bring it up to snuff and whack
tix.
Keith
ChangeLog
2001-08-28 Keith Seitz <keiths@redhat.com>
* library/tdump.tcl (class TdumpWin): Inherit from GDBWin
and ManagedWin.
(constructor): Remove old itcl2 handling code and name the
window.
(build_win): Use iwidgets::scrolledtext instead of
tixScrolledText.
(twin): Remove unused variable. Use itk_component(stext)
instead.
(maxwidth): Remove unused variable.
(destructor): Remove unused method.
(config): Ditto.
Patch
Index: library/tdump.tcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/tdump.tcl,v
retrieving revision 1.2
diff -u -p -r1.2 tdump.tcl
--- tdump.tcl 2001/06/04 15:49:53 1.2
+++ tdump.tcl 2001/08/28 23:25:34
@@ -1,5 +1,5 @@
-# Trace dump window for GDBtk.
-# Copyright 1998, 1999 Cygnus Solutions
+# Trace dump window for Insight
+# Copyright 1998, 1999, 2001 Red Hat, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License (GPL) as published by
@@ -28,28 +28,16 @@
#
# ----------------------------------------------------------------------
-itcl_class TdumpWin {
+class TdumpWin {
+ inherit ManagedWin GDBWin
+
# ------------------------------------------------------------------
# CONSTRUCTOR - create new tdump window
# ------------------------------------------------------------------
- constructor {config} {
- #
- # Create a window with the same name as this object
- #
- set class [$this info class]
- set hull [namespace tail $this]
- set old_name $this
- ::rename $this $this-tmp-
- ::frame $hull -class $class
- ::rename $hull $old_name-win-
- ::rename $this $old_name
-
- set top [winfo toplevel [namespace tail $this]]
- wm withdraw $top
-
+ constructor {args} {
+ window_name "Trace Dump"
build_win
- after idle [list wm deiconify $top]
-
+ eval itk_initialize $args
}
@@ -57,14 +45,24 @@ itcl_class TdumpWin {
# METHOD: build_win - build the main tdump window
# ------------------------------------------------------------------
method build_win {} {
+ global tcl_platform
- tixScrolledText [namespace tail $this].stext -scrollbar y -height 200 -width 500
- set twin [[namespace tail $this].stext subwidget text]
-
- # make window non editable
- $twin configure -insertwidth 0
+ if {[string compare $tcl_platform(platform) "windows"] == 0} {
+ set mode static
+ ide_sizebox $itk_interior.sbox
+ place $itk_interior.sbox -relx 1.0 -rely 1.0 -anchor se
+ } else {
+ set mode dynamic
+ }
- pack append [namespace tail $this] [namespace tail $this].stext {left expand fill}
+ itk_component add stext {
+ iwidgets::scrolledtext $itk_interior.stext -hscrollmode $mode \
+ -vscrollmode $mode -textfont src-font \
+ -background [pref get gdb/font/normal_bg]
+ } {}
+ [$itk_component(stext) component text] configure \
+ -background [pref get gdb/font/normal_bg]
+ pack $itk_component(stext) -side left -expand yes -fill both
update dummy
}
@@ -79,7 +77,7 @@ itcl_class TdumpWin {
if { $tframe_num!=-1 } {
debug "doing tdump"
- $twin delete 1.0 end
+ $itk_component(stext) delete 1.0 end
if {[catch {gdb_cmd "tdump $tframe_num" 0} tdump_output]} {
tk_messageBox -title "Error" -message $tdump_output -icon error \
@@ -87,37 +85,17 @@ itcl_class TdumpWin {
} else {
#debug "tdum output is $tdump_output"
- $twin insert end $tdump_output
- $twin see insert
+ $itk_component(stext) insert end $tdump_output
+ $itk_component(stext) see insert
}
}
gdbtk_idle
}
# ------------------------------------------------------------------
- # DESTRUCTOR - destroy window containing widget
- # ------------------------------------------------------------------
- destructor {
- set top [winfo toplevel [namespace tail $this]]
- destroy $this
- destroy $top
- }
-
- # ------------------------------------------------------------------
- # METHOD: config - used to change public attributes
- # ------------------------------------------------------------------
- method config {config} {}
-
- # ------------------------------------------------------------------
# METHOD: reconfig - used when preferences change
# ------------------------------------------------------------------
method reconfig {} {
}
-
- #
- # PROTECTED DATA
- #
- protected maxwidth 0
- protected twin
}