public inbox for insight@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] Add cascade menu to gdbmenubar
@ 2002-06-12 17:06 Keith Seitz
  0 siblings, 0 replies; only message in thread
From: Keith Seitz @ 2002-06-12 17:06 UTC (permalink / raw)
  To: Insight Maling List

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-06-13  0:06 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-12 17:06 [PATCH] Add cascade menu to gdbmenubar Keith Seitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).