This is the mail archive of the insight@sources.redhat.com mailing list for the Insight project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Add cascade menu to gdbmenubar


This has gone missing for too long.

Despite the comments in menubar_new_menu, the "menubutton" option to
GDBMenuBar::add does NOT add a cascading menu. It simply adds a new
pull-down menu to the main menu bar.

This patch adds a "real" cascading menu item to the current menu.
Keith

ChangeLog
2002-06-12  Keith Seitz  <keiths@redhat.com>

        * library/gdbmenubar.itcl (add): Add new "cascade" type.
        (menubar_add_cascade): New method to build cascading menus.

Patch
Index: library/gdbmenubar.itcl
===================================================================
RCS file: /cvs/src/src/gdb/gdbtk/library/gdbmenubar.itcl,v
retrieving revision 1.8
diff -p -r1.8 gdbmenubar.itcl
*** library/gdbmenubar.itcl	3 Aug 2001 18:46:41 -0000	1.8
--- library/gdbmenubar.itcl	13 Jun 2002 00:04:25 -0000
*************** class GDBMenuBar {
*** 118,123 ****
--- 118,126 ----
        separator {
          menubar_add_menu_separator
        }
+       cascade {
+ 	eval menubar_add_cascade $args
+       }
        default {
          error "Invalid item type: $type"
        }
*************** class GDBMenuBar {
*** 127,134 ****
    }

    # ------------------------------------------------------------------
!   #  PRIVATE METHOD:  menubar_new_menu - Add a new cascade menu to the
!   #                      main menu.
    #                      Also target this menu for subsequent
    #                      menubar_add_menu_command calls.
    #
--- 130,153 ----
    }

    # ------------------------------------------------------------------
!   #  NAME:         private method GDBMenuBar::menubar_add_cascade
!   #  DESCRIPTION:  Create a new cascading menu in the current menu
!   #
!   #  ARGUMENTS:    menu_name - the name of the menu to be created
!   #                label     - label to be displayed for the menu
!   #                underline - which element to underline for shortcuts
!   #  RETURNS:      Nothing
!   # ------------------------------------------------------------------
!   private method menubar_add_cascade {menu_name label underline} {
!     set m [menu $current_menu.$menu_name -tearoff false]
!     $current_menu add cascade -menu $m -label $label \
!       -underline $underline
!     set current_menu $m
!   }
!
!   # ------------------------------------------------------------------
!   #  PRIVATE METHOD:  menubar_new_menu - Add a new menu to the main
!   #                      menu.
    #                      Also target this menu for subsequent
    #                      menubar_add_menu_command calls.
    #


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]