diff options
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. # |