Create a default Cocoa menu that shows 'Services', 'Hide',
        'Hide Others', 'Show All', and 'Quit'. Will append the application name
        to some menu items if it's available.
1096
def _add_app_menu(self):
        
        # Set the main menu for the application
        mainMenu = AppKit.NSMenu.alloc().init()
        self.app.setMainMenu_(mainMenu)

        # Create an application menu and make it a submenu of the main menu
        mainAppMenuItem = AppKit.NSMenuItem.alloc().init()
        mainMenu.addItem_(mainAppMenuItem)
        appMenu = AppKit.NSMenu.alloc().init()
        mainAppMenuItem.setSubmenu_(appMenu)

        appMenu.addItemWithTitle_action_keyEquivalent_(self._append_app_name(localization["cocoa.menu.about"]), "orderFrontStandardAboutPanel:", "")

        appMenu.addItem_(AppKit.NSMenuItem.separatorItem())

        # Set the 'Services' menu for the app and create an app menu item
        appServicesMenu = AppKit.NSMenu.alloc().init()
        self.app.setServicesMenu_(appServicesMenu)
        servicesMenuItem = appMenu.addItemWithTitle_action_keyEquivalent_(localization["cocoa.menu.services"], nil, "")
        servicesMenuItem.setSubmenu_(appServicesMenu)

        appMenu.addItem_(AppKit.NSMenuItem.separatorItem())

        # Append the 'Hide', 'Hide Others', and 'Show All' menu items
        appMenu.addItemWithTitle_action_keyEquivalent_(self._append_app_name(localization["cocoa.menu.hide"]), "hide:", "h")
        hideOthersMenuItem = appMenu.addItemWithTitle_action_keyEquivalent_(localization["cocoa.menu.hideOthers"], "hideOtherApplications:", "h")
        hideOthersMenuItem.setKeyEquivalentModifierMask_(AppKit.NSAlternateKeyMask | AppKit.NSCommandKeyMask)
        appMenu.addItemWithTitle_action_keyEquivalent_(localization["cocoa.menu.showAll"], "unhideAllApplications:", "")

        appMenu.addItem_(AppKit.NSMenuItem.separatorItem())

        # Append a 'Quit' menu item
        appMenu.addItemWithTitle_action_keyEquivalent_(self._append_app_name(localization["cocoa.menu.quit"]), "terminate:", "q")
677810
def create_shortcuts(self, parent):
        """"""
        # Configurable
        findnext = config_shortcut(self.find_next, context='_',
                                   name='Find next', parent=parent)
        findprev = config_shortcut(self.find_previous, context='_',
                                   name='Find previous', parent=parent)
        togglefind = config_shortcut(self.show, context='_',
                                     name='Find text', parent=parent)
        togglereplace = config_shortcut(self.show_replace,
                                        context='_', name='Replace text',
                                        parent=parent)
        hide = config_shortcut(self.hide, context='_', name='hide find and replace',
                               parent=self)

        return [findnext, findprev, togglefind, togglereplace, hide]
728228
def menu(menu_config=None, **kwargs):
    
    request = kwargs.pop("request", None)
    user = kwargs.pop("user", None)
    url_full_name = ":".join(
        [request.resolver_match.namespace, request.resolver_match.url_name]
    )

    if not menu_config:
        menu_config = settings.ARCTIC_MENU

    menu_dict = OrderedDict()
    for menu_entry in menu_config:
        if type(menu_entry) in (list, tuple):

            # check permission based on named_url
            path = None
            if menu_entry[1]:
                if not view_from_url(menu_entry[1]).has_permission(user):
                    continue

                path = reverse(menu_entry[1])
            # icons and collapse are optional
            icon = None
            if (len(menu_entry) >= 3) and (
                not type(menu_entry[2]) in (list, tuple)
            ):
                icon = menu_entry[2]
            active_weight = len(path) if path else 0
            menu_dict[menu_entry[0]] = {
                "url": menu_entry[1],
                "icon": icon,
                "submenu": None,
                "active": is_active(menu_entry, url_full_name),
                "active_weight": active_weight,
            }

            # check if the last item in a menu entry is a submenu
            submenu = _get_submenu(menu_entry)
            if submenu:
                menu_dict[menu_entry[0]]["submenu"] = menu(
                    submenu, user=user, request=request
                )
    return menu_clean(menu_dict)
1289659
def __setupMenus(self):
        
        if True:
            # Don't use self.menuBar(), on OS-X this is not shared across windows.
            # See: http://qt-project.org/doc/qt-4.8/qmenubar.html#details
            # And:http://qt-project.org/doc/qt-4.8/qmainwindow.html#menuBar
            menuBar = QtWidgets.QMenuBar() # Make a menu without parent.
            self.setMenuBar(menuBar)
        else:
            menuBar = self.menuBar()

        ### File Menu ###

        fileMenu = menuBar.addMenu("&File")

        fileMenu.addAction("&New Window", self.cloneWindow, QtGui.QKeySequence("Ctrl+N"))
        fileMenu.addAction("Close &Window", self.close, QtGui.QKeySequence.Close)

        fileMenu.addSeparator()

        action = fileMenu.addAction("Browse Directory...",
            lambda: self.openFiles(fileMode = QtWidgets.QFileDialog.Directory))
        action.setShortcut(QtGui.QKeySequence("Ctrl+B"))

        action = fileMenu.addAction("&Open Files...",
            lambda: self.openFiles(fileMode = QtWidgets.QFileDialog.ExistingFiles))
        action.setShortcut(QtGui.QKeySequence("Ctrl+O"))

        openAsMenu = fileMenu.addMenu("Open As")
        for rtiRegItem in self.argosApplication.rtiRegistry.items:
            #rtiRegItem.tryImportClass()
            def createTrigger():
                "Function to create a closure with the regItem"
                _rtiRegItem = rtiRegItem # keep reference in closure
                return lambda: self.openFiles(rtiRegItem=_rtiRegItem,
                                              fileMode = QtWidgets.QFileDialog.ExistingFiles,
                                              caption="Open {}".format(_rtiRegItem.name))

            action = QtWidgets.QAction("{}...".format(rtiRegItem.name), self,
                enabled=True, # Since this is only executed at start-up, it must be static
                #enabled=bool(rtiRegItem.successfullyImported), # TODO: make this work?
                triggered=createTrigger())
            openAsMenu.addAction(action)

        fileMenu.addSeparator()

        # for action in self.repoWidget.repoTreeView.topLevelItemActionGroup.actions():
        #     fileMenu.addAction(action)
        #
        # for action in self.repoWidget.repoTreeView.currentItemActionGroup.actions():
        #     fileMenu.addAction(action)

        fileMenu.addSeparator()
        fileMenu.addAction("E&xit", self.argosApplication.closeAllWindows, QtGui.QKeySequence.Quit)

        ### View Menu ###
        self.viewMenu = menuBar.addMenu("&View")
        action = self.viewMenu.addAction("Installed &Plugins...", self.execPluginsDialog)
        action.setShortcut(QtGui.QKeySequence("Ctrl+P"))
        self.viewMenu.addSeparator()

        ### Inspector Menu ###
        self.execInspectorDialogAction = QtWidgets.QAction("&Browse Inspectors...", self,
                                                           triggered=self.execInspectorDialog)
        self.execInspectorDialogAction.setShortcut(QtGui.QKeySequence("Ctrl+i"))

        self.inspectorActionGroup = self.__createInspectorActionGroup(self)
        self.inspectorMenu = menuBar.addMenu("Inspector")
        addInspectorActionsToMenu(self.inspectorMenu, self.execInspectorDialogAction,
                                  self.inspectorActionGroup)

        ### Window Menu ###
        self.windowMenu = menuBar.addMenu("&Window")

        # The action added to the menu in the repopulateWindowMenu method, which is called by
        # the ArgosApplication object every time a window is added or removed.
        self.activateWindowAction = QtWidgets.QAction("Window #{}".format(self.windowNumber),
                                                      self, triggered=self.activateAndRaise,
                                                      checkable=True)
        if self.windowNumber <= 9:
            self.activateWindowAction.setShortcut(QtGui.QKeySequence("Alt+{}"
                                                                     .format(self.windowNumber)))
        ### Help Menu ###
        menuBar.addSeparator()
        helpMenu = menuBar.addMenu("&Help")
        helpMenu.addAction('&About...', self.about)

        if DEBUGGING:
            helpMenu.addSeparator()
            helpMenu.addAction("&Test", self.myTest, "Alt+T")
            helpMenu.addAction("Add Test Data", self.addTestData, "Alt+A")

        ### Context menu ###

        # Note that the dock-widgets have a Qt.PreventContextMenu context menu policy.
        # Therefor the context menu is only shown in the center widget.
        self.setContextMenuPolicy(Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self.showContextMenu)
177948
def init_app(self, app):
        
        app.config.setdefault('PRETTIFY', False)

        if app.config['PRETTIFY']:
            app.after_request(self._prettify_response)
1236609
def initialize(**kwargs):
    
    global config
    config_opts = kwargs.setdefault('config',{})

    if isinstance(config_opts,basestring):
        config_opts = {'config_filename':config_opts}
        kwargs['config'] = config_opts

    if 'environment' in kwargs:
        config_opts['environment'] = kwargs['environment']

    config.load_config(**config_opts)

    # Overlay the subconfig
    if kwargs.get('name'):
        subconfig = config.get(kwargs.get('name'),{})
        config.overlay_add(subconfig)

    config.overlay_add(app_config)
849736
def create_manifest(self):
        
        self.manifest = {}
        self.manifest['applications'] = [{'name': self.app_name}]
        self.manifest['services'] = []
        self.manifest['env'] = {
                'PREDIXPY_VERSION': str(predix.version),
                }

        self.write_manifest()
158236
def add_menu(self, name):
        
        if name in self._menus:
            raise exceptions.MenuAlreadyExists("Menu name {!r} already exists.".format(name))
        menu = self._menu.addMenu(name)
        self._menus[name] = menu
256533
def _create_application(self):
        
        return Application(
            input=self.input,
            output=self.output,
            layout=self.ptpython_layout.layout,
            key_bindings=merge_key_bindings([
                load_python_bindings(self),
                load_auto_suggest_bindings(),
                load_sidebar_bindings(self),
                load_confirm_exit_bindings(self),
                ConditionalKeyBindings(
                    load_open_in_editor_bindings(),
                    Condition(lambda: self.enable_open_in_editor)),
                # Extra key bindings should not be active when the sidebar is visible.
                ConditionalKeyBindings(
                    self.extra_key_bindings,
                    Condition(lambda: not self.show_sidebar))
            ]),
            color_depth=lambda: self.color_depth,
            paste_mode=Condition(lambda: self.paste_mode),
            mouse_support=Condition(lambda: self.enable_mouse_support),
            style=DynamicStyle(lambda: self._current_style),
            style_transformation=self.style_transformation,
            include_default_pygments_style=False,
            reverse_vi_search_direction=True)
817979
def init_app(self, app, session):
        
        app.config.setdefault("APP_NAME", "F.A.B.")
        app.config.setdefault("APP_THEME", "")
        app.config.setdefault("APP_ICON", "")
        app.config.setdefault("LANGUAGES", {"en": {"flag": "gb", "name": "English"}})
        app.config.setdefault("ADDON_MANAGERS", [])
        app.config.setdefault("FAB_API_MAX_PAGE_SIZE", 20)
        self.app = app
        if self.update_perms:  # default is True, if False takes precedence from config
            self.update_perms = app.config.get('FAB_UPDATE_PERMS', True)
        _security_manager_class_name = app.config.get('FAB_SECURITY_MANAGER_CLASS', None)
        if _security_manager_class_name is not None:
            self.security_manager_class = dynamic_class_import(
                _security_manager_class_name
            )
        if self.security_manager_class is None:
            from flask_appbuilder.security.sqla.manager import SecurityManager
            self.security_manager_class = SecurityManager

        self._addon_managers = app.config["ADDON_MANAGERS"]
        self.session = session
        self.sm = self.security_manager_class(self)
        self.bm = BabelManager(self)
        self.openapi_manager = OpenApiManager(self)
        self._add_global_static()
        self._add_global_filters()
        app.before_request(self.sm.before_request)
        self._add_admin_views()
        self._add_addon_views()
        if self.app:
            self._add_menu_permissions()
        else:
            self.post_init()
        self._init_extension(app)
700399
def create_menubar(MAIN):
    """"""
    actions = MAIN.action
    menubar = MAIN.menuBar()
    menubar.clear()

    """ ------ FILE ------ """
    menu_file = menubar.addMenu('File')
    menu_file.addAction(MAIN.info.action['open_dataset'])
    submenu_recent = menu_file.addMenu('Recent Datasets')
    submenu_recent.addActions(MAIN.info.action['open_recent'])
    menu_file.addAction(MAIN.info.action['export'])

    menu_file.addSeparator()
    menu_file.addAction(actions['open_settings'])
    menu_file.addSeparator()
    menu_file.addAction(actions['close_wndw'])

    """ ------ CHANNELS ------ """
    actions = MAIN.channels.action
    menu_time = menubar.addMenu('Channels')
    menu_time.addAction(actions['load_channels'])
    menu_time.addAction(actions['save_channels'])

    """ ------ NAVIGATION ------ """
    actions = MAIN.traces.action

    menu_time = menubar.addMenu('Navigation')
    menu_time.addAction(actions['step_prev'])
    menu_time.addAction(actions['step_next'])
    menu_time.addAction(actions['page_prev'])
    menu_time.addAction(actions['page_next'])
    menu_time.addSeparator()
    menu_time.addAction(actions['addtime_-6h'])
    menu_time.addAction(actions['addtime_-1h'])
    menu_time.addAction(actions['addtime_-10min'])
    menu_time.addAction(actions['addtime_10min'])
    menu_time.addAction(actions['addtime_1h'])
    menu_time.addAction(actions['addtime_6h'])
    menu_time.addSeparator()
    menu_time.addAction(actions['next_event'])
    menu_time.addAction(actions['del_and_next_event'])
    menu_time.addAction(actions['next_of_same_type'])
    menu_time.addAction(actions['centre_event'])
    menu_time.addSeparator()
    menu_time.addAction(actions['go_to_epoch'])
    menu_time.addAction(actions['line_up_with_epoch'])

    """ ------ VIEW ------ """
    actions = MAIN.traces.action

    menu_view = menubar.addMenu('View')
    submenu_ampl = menu_view.addMenu('Global Scaling')
    submenu_ampl.addAction(actions['Y_less'])
    submenu_ampl.addAction(actions['Y_more'])
    submenu_ampl.addSeparator()
    for x in sorted(MAIN.value('y_scale_presets'), reverse=True):
        act = submenu_ampl.addAction('Set to ' + str(x))
        act.triggered.connect(partial(MAIN.traces.Y_ampl, x))

    submenu_dist = menu_view.addMenu('Distance Between Traces')
    submenu_dist.addAction(actions['Y_wider'])
    submenu_dist.addAction(actions['Y_tighter'])
    submenu_dist.addSeparator()
    for x in sorted(MAIN.value('y_distance_presets'),
                    reverse=True):
        act = submenu_dist.addAction('Set to ' + str(x))
        act.triggered.connect(partial(MAIN.traces.Y_dist, x))

    submenu_length = menu_view.addMenu('Window Length')
    submenu_length.addAction(actions['X_more'])
    submenu_length.addAction(actions['X_less'])
    submenu_length.addSeparator()
    for x in sorted(MAIN.value('window_length_presets'),
                    reverse=True):
        act = submenu_length.addAction('Set to ' + str(x))
        act.triggered.connect(partial(MAIN.traces.X_length, x))

    menu_view.addAction(actions['cross_chan_mrk'])

    menu_view.addSeparator()
    menu_view.addAction(actions['export_svg'])

    """ ------ ANNOTATIONS ------ """
    actions = MAIN.notes.action

    menu_annot = menubar.addMenu('Annotations')
    menu_annot.addAction(actions['new_annot'])
    menu_annot.addAction(actions['load_annot'])
    menu_annot.addAction(actions['clear_annot'])
    menu_annot.addSeparator()

    submenu_rater = menu_annot.addMenu('Rater')
    submenu_rater.addAction(actions['new_rater'])
    submenu_rater.addAction(actions['rename_rater'])
    submenu_rater.addAction(actions['del_rater'])
    submenu_rater.addSeparator()
    if MAIN.notes.annot is not None:
        for rater in sorted(MAIN.notes.annot.raters):
            act = submenu_rater.addAction(rater)
            act.triggered.connect(partial(MAIN.notes.select_rater, rater))
    menu_annot.addSeparator()

    submenu_marker = menu_annot.addMenu('Bookmark')
    submenu_marker.addAction(actions['new_bookmark'])

    submenu_event = menu_annot.addMenu('Event')
    submenu_event.addAction(actions['new_eventtype'])
    submenu_event.addAction(actions['del_eventtype'])
    submenu_event.addAction(actions['rename_eventtype'])
    submenu_mrk2evt = submenu_event.addMenu('Markers into Events')
    submenu_mrk2evt.addAction(actions['m2e_newname'])
    submenu_mrk2evt.addAction(actions['m2e_keepname'])
    submenu_event.addAction(actions['merge_events'])
    submenu_event.addAction(MAIN.traces.action['change_event_type'])

    # these are the real QActions attached to notes
    submenu_stage = menu_annot.addMenu('Stage')
    submenu_stage.addActions(MAIN.notes.actions())

    submenu_mrkr = menu_annot.addMenu('Cycle')
    submenu_mrkr.addAction(actions['cyc_start'])
    submenu_mrkr.addAction(actions['cyc_end'])
    submenu_mrkr.addAction(actions['remove_cyc'])
    submenu_mrkr.addAction(actions['clear_cyc'])
    menu_annot.addSeparator()

    submenu_import = menu_annot.addMenu('Import Staging')
    submenu_import.addAction(actions['import_alice'])
    submenu_import.addAction(actions['import_compumedics'])
    submenu_import.addAction(actions['import_deltamed'])
    submenu_import.addAction(actions['import_domino'])
    submenu_import.addAction(actions['import_prana'])
    submenu_import.addAction(actions['import_remlogic'])
    submenu_import.addAction(actions['import_sandman'])
    submenu_import.addAction(actions['import_fasst'])

    submenu_import_qual = menu_annot.addMenu('Import Signal Quality')
    submenu_import_qual.addAction(actions['import_alice_qual'])
    submenu_import_qual.addAction(actions['import_compumedics_qual'])
    submenu_import_qual.addAction(actions['import_deltamed_qual'])
    submenu_import_qual.addAction(actions['import_domino_qual'])
    submenu_import_qual.addAction(actions['import_prana_qual'])
    submenu_import_qual.addAction(actions['import_remlogic_qual'])
    submenu_import_qual.addAction(actions['import_sandman_qual'])
    
    submenu_import_event = menu_annot.addMenu('Import Events')
    submenu_import_event.addAction(actions['import_events_wonambi'])
    submenu_import_event.addAction(actions['import_events_remlogic'])
    menu_annot.addSeparator()
    
    submenu_export_staging = menu_annot.addMenu('Export Staging')
    submenu_export_staging.addAction(actions['export_to_csv'])
    submenu_export_staging.addAction(actions['export_to_remlogic'])
    submenu_export_staging.addAction(actions['export_to_remlogic_fr'])

    menu_annot.addAction(actions['export_events'])    
    menu_annot.addSeparator()
    
    menu_annot.addAction(actions['export_sleepstats'])

    """ ------ ANALYSIS ------ """
    actions = MAIN.notes.action

    menu_analysis = menubar.addMenu('Analysis')

    submenu_detect = menu_analysis.addMenu('Detection')
    submenu_detect.addAction(actions['spindle'])
    submenu_detect.addAction(actions['slow_wave'])

    menu_analysis.addAction(actions['analyze'])


    """ ------ WINDOWS ------ """
    actions = MAIN.action

    menu_window = menubar.addMenu('Windows')
    for dockwidget_act in actions['dockwidgets']:
        menu_window.addAction(dockwidget_act)
    MAIN.menu_window = menu_window

    menu_about = menubar.addMenu('About')
    menu_about.addAction(actions['about'])
    menu_about.addAction(actions['aboutqt'])
66855
def init_menu():
    """"""
    # Register settings menu
    item = current_menu.submenu('settings.admin')
    item.register(
        "admin.index",
        # NOTE: Menu item text (icon replaced by a cogs icon).
        _('%(icon)s Administration', icon='<i class="fa fa-cogs fa-fw"></i>'),
        visible_when=_has_admin_access,
        order=100)
981913
def _create_application(self):
        
        # Create Application.
        application = Application(
            input=self.input,
            output=self.output,
            editing_mode=EditingMode.VI,
            layout=self.editor_layout.layout,
            key_bindings=self.key_bindings,
#            get_title=lambda: get_terminal_title(self),
            style=DynamicStyle(lambda: self.current_style),
            paste_mode=Condition(lambda: self.paste_mode),
#            ignore_case=Condition(lambda: self.ignore_case),  # TODO
            include_default_pygments_style=False,
            mouse_support=Condition(lambda: self.enable_mouse_support),
            full_screen=True,
            enable_page_navigation_bindings=True)

        # Handle command line previews.
        # (e.g. when typing ':colorscheme blue', it should already show the
        # preview before pressing enter.)
        def preview(_):
            if self.application.layout.has_focus(self.command_buffer):
                self.previewer.preview(self.command_buffer.text)
        self.command_buffer.on_text_changed += preview

        return application
1291790
def merge_config(config)
      defaults = {
        name: 'Ruby App',
        version: '0.0.0',
        release: 'Rookie',
        ignore: 'pkg',
        # TODO: Establish these default icons and paths. These would be
        # default icons for generic Ruby apps.
        icons: {
          #osx: 'path/to/default/App.icns',
          #gtk: 'path/to/default/app.png',
          #win32: 'path/to/default/App.ico',
        },
        template_urls: {
          jar_app: JAR_APP_TEMPLATE_URL,
        },
        validator: Furoshiki::Validator,
        warbler_extensions: Furoshiki::WarblerExtensions,
        working_dir: Dir.pwd,
      }

      @config = merge_with_symbolized_keys(defaults, config)
    end
206933
def _popup_menu(self, icon, button, time, extended=True):
        """"""
        m = self.create_context_menu(extended)
        m.show_all()
        m.popup(parent_menu_shell=None,
                parent_menu_item=None,
                func=icon.position_menu,
                data=icon,
                button=button,
                activate_time=time)
        # need to store reference or menu will be destroyed before showing:
        self._m = m
1013276
private void setupAppChooser() {
    // Configurator to choose the main application
    appCombo = new JComboBox<>();
    for(Class<?> clz : ELKIServiceRegistry.findAllImplementations(AbstractApplication.class)) {
      String nam = clz.getCanonicalName();
      if(nam == null || clz.getCanonicalName().contains("GUI")) {
        continue;
      }
      if(nam.startsWith(APP_PREFIX)) {
        nam = nam.substring(APP_PREFIX.length());
      }
      appCombo.addItem(nam);
    }
    appCombo.setEditable(true);
    String sel = maincls.getCanonicalName();
    if(sel.startsWith(APP_PREFIX)) {
      sel = sel.substring(APP_PREFIX.length());
    }
    appCombo.setSelectedItem(sel);
    appCombo.addActionListener((e) -> {
      if("comboBoxChanged".equals(e.getActionCommand())) {
        Class<? extends AbstractApplication> clz = ELKIServiceRegistry.findImplementation(AbstractApplication.class, (String) appCombo.getSelectedItem());
        if(clz != null) {
          maincls = clz;
          updateParameterTable();
        }
        else {
          LOG.warning("Main class name not found.");
        }
      }
    }
877470
def CreateMenuBar(self):
        """"""
        menubar = wx.MenuBar()
        menu = wx.Menu()
        menu.Append(ID_OPEN, _('&Open Profile'), _('Open a cProfile file'))
        menu.Append(ID_OPEN_MEMORY, _('Open &Memory'), _('Open a Meliae memory-dump file'))
        menu.AppendSeparator()
        menu.Append(ID_EXIT, _('&Close'), _('Close this RunSnakeRun window'))
        menubar.Append(menu, _('&File'))
        menu = wx.Menu()
#        self.packageMenuItem = menu.AppendCheckItem(
#            ID_PACKAGE_VIEW, _('&File View'),
#            _('View time spent by package/module')
#        )
        self.percentageMenuItem = menu.AppendCheckItem(
            ID_PERCENTAGE_VIEW, _('&Percentage View'),
            _('View time spent as percent of overall time')
        )
        self.rootViewItem = menu.Append(
            ID_ROOT_VIEW, _('&Root View (Home)'),
            _('View the root of the tree')
        )
        self.backViewItem = menu.Append(
            ID_BACK_VIEW, _('&Back'), _('Go back in your viewing history')
        )
        self.upViewItem = menu.Append(
            ID_UP_VIEW, _('&Up'),
            _('Go "up" to the parent of this node with the largest cumulative total')
        )
        self.moreSquareViewItem = menu.AppendCheckItem(
            ID_MORE_SQUARE, _('&Hierarchic Squares'),
            _('Toggle hierarchic squares in the square-map view')
        )

        # This stuff isn't really all that useful for profiling,
        # it's more about how to generate graphics to describe profiling...
        self.deeperViewItem = menu.Append(
            ID_DEEPER_VIEW, _('&Deeper'), _('View deeper squaremap views')
        )
        self.shallowerViewItem = menu.Append(
            ID_SHALLOWER_VIEW, _('&Shallower'), _('View shallower squaremap views')
        )
#        wx.ToolTip.Enable(True)
        menubar.Append(menu, _('&View'))
        
        self.viewTypeMenu =wx.Menu( )
        menubar.Append(self.viewTypeMenu, _('View &Type'))
        
        self.SetMenuBar(menubar)

        wx.EVT_MENU(self, ID_EXIT, lambda evt: self.Close(True))
        wx.EVT_MENU(self, ID_OPEN, self.OnOpenFile)
        wx.EVT_MENU(self, ID_OPEN_MEMORY, self.OnOpenMemory)
        
        wx.EVT_MENU(self, ID_PERCENTAGE_VIEW, self.OnPercentageView)
        wx.EVT_MENU(self, ID_UP_VIEW, self.OnUpView)
        wx.EVT_MENU(self, ID_DEEPER_VIEW, self.OnDeeperView)
        wx.EVT_MENU(self, ID_SHALLOWER_VIEW, self.OnShallowerView)
        wx.EVT_MENU(self, ID_ROOT_VIEW, self.OnRootView)
        wx.EVT_MENU(self, ID_BACK_VIEW, self.OnBackView)
        wx.EVT_MENU(self, ID_MORE_SQUARE, self.OnMoreSquareToggle)