diff options
author | Fernando Nasser <fnasser@redhat.com> | 2001-01-28 18:39:00 +0000 |
---|---|---|
committer | Fernando Nasser <fnasser@redhat.com> | 2001-01-28 18:39:00 +0000 |
commit | f8b810b65c29612fb005e9320fa825f8907d481e (patch) | |
tree | 5e01d50d79ee3d734a07dbcffe15831548d155bc /gdb | |
parent | 2d547512e39b9de38dd096511d3f893cc31976b5 (diff) | |
download | gdb-f8b810b65c29612fb005e9320fa825f8907d481e.tar.gz |
2001-01-28 Fernando Nasser <fnasser@redhat.com>
* library/gdbmenubar.itcl (menubar_new_menu): Save lable of a menu to
use as index.
(menubar_delete_menu): New function. Delete a menu.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/gdbtk/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/gdbtk/library/gdbmenubar.itcl | 21 |
2 files changed, 27 insertions, 0 deletions
diff --git a/gdb/gdbtk/ChangeLog b/gdb/gdbtk/ChangeLog index 08ac50e143f..78ffc79ab6e 100644 --- a/gdb/gdbtk/ChangeLog +++ b/gdb/gdbtk/ChangeLog @@ -1,5 +1,11 @@ 2001-01-28 Fernando Nasser <fnasser@redhat.com> + * library/gdbmenubar.itcl (menubar_new_menu): Save lable of a menu to + use as index. + (menubar_delete_menu): New function. Delete a menu. + +2001-01-28 Fernando Nasser <fnasser@redhat.com> + * library/gdbmenubar.itcl (menu_list): Add missing declararion for global variable. diff --git a/gdb/gdbtk/library/gdbmenubar.itcl b/gdb/gdbtk/library/gdbmenubar.itcl index c4c739bd3e5..533426f44dc 100644 --- a/gdb/gdbtk/library/gdbmenubar.itcl +++ b/gdb/gdbtk/library/gdbmenubar.itcl @@ -115,6 +115,7 @@ class GDBMenuBar { set menu_list($name) [$Menu add cascade -menu $current_menu \ -label $label -underline $underline] menu $current_menu -tearoff 0 + set menu_list($name,label) $label set item_number -1 return $current_menu @@ -156,6 +157,26 @@ class GDBMenuBar { } # ------------------------------------------------------------------ + # METHOD: menubar_delete_menu - Deletes one of the main menu + # cascade menus. Also makes the previous menu the + # target menu. + # + # name - the token for the new menu + # + # RETURNS: then item number of the menu, or "" if the menu is not found. + # + # FIXME: Does not remove the deleted menus from their class lists. + # ------------------------------------------------------------------ + method menubar_delete_menu {name} { + if {[info exists menu_list($name)]} { + $Menu delete $menu_list($name,label) + set current_menu {} + unset menu_list($name,label) + unset menu_list($name) + } + } + + # ------------------------------------------------------------------ # METHOD: menubar_add_menu_separator - Adds a menu separator to # the currently targeted submenu of the main menu. # |