diff options
author | Fernando Nasser <fnasser@redhat.com> | 2001-02-01 17:59:38 +0000 |
---|---|---|
committer | Fernando Nasser <fnasser@redhat.com> | 2001-02-01 17:59:38 +0000 |
commit | 58617a1e30b6d65ac8a1bf9efe4342abdce86c06 (patch) | |
tree | 3e3a39b480bc2dca369f240f87486af3d2f2dbb8 /gdb/gdbtk | |
parent | c361d98b7d0929641f61cbc373a3d8a6e783c98a (diff) | |
download | gdb-58617a1e30b6d65ac8a1bf9efe4342abdce86c06.tar.gz |
2001-02-01 Fernando Nasser <fnasser@redhat.com>
* library/pluginwin.itcl (contrucdtor, destructor): Use "code" to
specify callbacks.
(running, stopped, no_inferior): Make it a protected method.
(childsite): Explicitly mark as a public method.
* library/plugins/rhabout/rhabout.itcl (constructor): Add a label
widget to show status messages.
(running, stopped): Overload versions of the base class; display
status messages as an example.
Diffstat (limited to 'gdb/gdbtk')
-rw-r--r-- | gdb/gdbtk/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/gdbtk/library/plugins/rhabout/rhabout.itcl | 40 | ||||
-rw-r--r-- | gdb/gdbtk/library/pluginwin.itcl | 24 |
3 files changed, 60 insertions, 15 deletions
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog index 87528a976ca..922cde9692c 100644 --- a/gdb/gdbtk/ChangeLog +++ b/gdb/gdbtk/ChangeLog @@ -1,3 +1,14 @@ +2001-02-01 Fernando Nasser <fnasser@redhat.com> + + * library/pluginwin.itcl (contrucdtor, destructor): Use "code" to + specify callbacks. + (running, stopped, no_inferior): Make it a protected method. + (childsite): Explicitly mark as a public method. + * library/plugins/rhabout/rhabout.itcl (constructor): Add a label + widget to show status messages. + (running, stopped): Overload versions of the base class; display + status messages as an example. + 2001-01-31 Fernando Nasser <fnasser@redhat.com> * library/pluginwin.itcl: New file. Implements the PluginWindow diff --git a/gdb/gdbtk/library/plugins/rhabout/rhabout.itcl b/gdb/gdbtk/library/plugins/rhabout/rhabout.itcl index e96fd54fc1b..61a022ed6dc 100644 --- a/gdb/gdbtk/library/plugins/rhabout/rhabout.itcl +++ b/gdb/gdbtk/library/plugins/rhabout/rhabout.itcl @@ -1,5 +1,4 @@ class RHAbout { -# inherit PluginWindow ModalDialog inherit PluginWindow constructor {args} { global gdb_ImageDir @@ -43,10 +42,20 @@ class RHAbout { # Here we call a command procedure that we created, if it exists catch {append text [rhabout_extra_text]} + # Now add the text message $f.m -bg white -fg black -text $text -aspect 500 -relief flat + + # Add a status bar so we can show some dynamic information + set _status [label $f.stat -relief sunken -bd 3 \ + -font global/status -height 1] + + # pack everything pack $f.image1 $f.m -fill both -expand yes + pack $f.stat -expand 1 -fill both pack $itk_interior - window_name "About Red Hat Insight" + + # Give our sample window a name + window_name "About Red Hat Insight Plug-In" } # Don't quit if this is the last window. The only way that this can @@ -56,5 +65,30 @@ class RHAbout { return 0 } -} + # You can overload the base class running method, but make sure + # to call it as well or the menu and button status will not be updated + # (unless this is what you want) + private method running {} { + debug + # Call the baseclass version + PluginWindow::running + + # Display something in the status area + $_status configure -text "Running..." + } + + # You can overload the base class stopped method, but make sure + # to call it as well or the menu and button status will not be updated + # (unless this is what you want) + private method stopped {} { + debug + # First call the baseclass version + PluginWindow::stopped + # Display something in the status area + $_status configure -text "Stopped." + } + + # Path to the status area + private variable _status +} diff --git a/gdb/gdbtk/library/pluginwin.itcl b/gdb/gdbtk/library/pluginwin.itcl index 18574be7367..fded5a9739e 100644 --- a/gdb/gdbtk/library/pluginwin.itcl +++ b/gdb/gdbtk/library/pluginwin.itcl @@ -52,18 +52,18 @@ class PluginWindow { pack $child -expand 1 -fill both eval itk_initialize $args - add_hook gdb_idle_hook "$this stopped" - add_hook gdb_busy_hook "$this running" - add_hook gdb_no_inferior_hook "$this no_inferior" + add_hook gdb_idle_hook [code $this stopped] + add_hook gdb_busy_hook [code $this running] + add_hook gdb_no_inferior_hook [code $this no_inferior] } # ------------------------------------------------------------------ # DESTRUCTOR - destroy window containing widget # ------------------------------------------------------------------ destructor { - remove_hook gdb_idle_hook "$this stopped" - remove_hook gdb_busy_hook "$this running" - remove_hook gdb_no_inferior_hook "$this no_inferior" + remove_hook gdb_idle_hook [code $this stopped] + remove_hook gdb_busy_hook [code $this running] + remove_hook gdb_no_inferior_hook [code $this no_inferior] #destroy $this } @@ -71,7 +71,7 @@ class PluginWindow { # ------------------------------------------------------------------ # ACCESSOR METHOD - Retrieve childsite # ------------------------------------------------------------------ - method childsite {} { + public method childsite {} { return $child } @@ -85,8 +85,8 @@ class PluginWindow { # METHOD: stopped # Invoked when there is an inferior and it has stopped # ------------------------------------------------------------------ - method stopped {} { - debug + protected method stopped {} { + debug "PluginWindow::stopped" enable_ui 1 } @@ -94,8 +94,8 @@ class PluginWindow { # METHOD: running # Invoked when gdb is going to run the inferior # ------------------------------------------------------------------ - method running {} { - debug + protected method running {} { + debug "PluginWindow::running" enable_ui 0 } @@ -103,7 +103,7 @@ class PluginWindow { # METHOD: no_inferior # Invoked when gdb detects the inferior is gone # ------------------------------------------------------------------ - method no_inferior {} { + protected method no_inferior {} { debug enable_ui 2 } |