.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2025 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.ribbon.RibbonBar: ========================================================================================================================================== |phoenix_title| **wx.ribbon.RibbonBar** ========================================================================================================================================== Top-level control in a ribbon user interface. Serves as a tabbed container for :ref:`wx.ribbon.RibbonPage` - a ribbon user interface typically has a ribbon bar, which contains one or more RibbonPages, which in turn each contain one or more RibbonPanels, which in turn contain controls. While a :ref:`wx.ribbon.RibbonBar` has tabs similar to a :ref:`wx.Notebook`, it does not follow the same API for adding pages. Containers like :ref:`wx.Notebook` can contain any type of window as a page, hence the normal procedure is to create the sub-window and then call :meth:`wx.BookCtrlBase.AddPage` . As :ref:`wx.ribbon.RibbonBar` can only have :ref:`wx.ribbon.RibbonPage` as children (and a :ref:`wx.ribbon.RibbonPage` can only have a :ref:`wx.ribbon.RibbonBar` as parent), when a page is created, it is automatically added to the bar - there is no AddPage equivalent to call. A ribbon bar can also show a `Backstage` from a "File" tab (see :meth:`~wx.ribbon.RibbonBar.SetBackstagePage` and :meth:`~wx.ribbon.RibbonBar.SetBackstage`). After all pages have been created, and all controls and panels placed on those pages, :meth:`~wx.ribbon.RibbonBar.Realize` must be called. |phoenix_title| KeyTips ======================= Since wxWidgets 3.3.4, pressing ``WXK_F10`` shows "KeyTips": a badge over every element which has one, listing the letters to type to activate it. Unlike mnemonics, KeyTips are not derived from labels; an element only takes part if it was assigned one explicitly. See :meth:`~wx.ribbon.RibbonBar.SetPageKeyTip`, :meth:`wx.ribbon.RibbonButtonBar.SetKeyTip` and the other ``SetKeyTip()`` overloads. Multi-character KeyTips are supported; typing the first character narrows the badges down to the elements sharing it. A KeyTip must therefore not be a strict prefix of another visible at the same time, or it could never fire. This is not validated at run time. ``WXK_ESCAPE`` backs out one character, or leaves the mode if nothing was typed. Pressing the trigger key again, clicking the ribbon, or the frame being deactivated also leave it. ``CTRL`` and ``ALT`` combinations are treated as accelerators: the mode is left and the key passed on, so ``CTRL-S`` is not consumed by a button with KeyTip ``"S"`` . Activating a page tab is the one case which stays in the mode, showing the new page's KeyTips. The trigger key is configurable, see :meth:`~wx.ribbon.RibbonBar.SetKeyTipsTriggerKey`. It is only consumed if there is something to show, so applications using no KeyTips keep their existing ``WXK_F10`` handling. |phoenix_title| Keyboard navigation =================================== Since wxWidgets 3.3.4, the ribbon can be used with the keyboard. For the best results, put it in a :ref:`wx.Panel` (or other window supporting tab navigation) instead of directly in a :ref:`wx.Frame`. On the tabs, the arrow keys, ``WXK_HOME`` , and ``WXK_END`` switch the page, and ``WXK_RETURN`` , ``WXK_SPACE`` , or ``WXK_DOWN`` go into it. In the page, ``WXK_TAB`` and the arrow keys move between the items of the button bars, tool bars, galleries, and panels. ``WXK_RETURN`` or ``WXK_SPACE`` activate the current one, and ``WXK_ESCAPE`` goes back to the tabs. |phoenix_title| Screen readers ============================== .. _RibbonBar-styles: |styles| Window Styles ================================ Since wxWidgets 3.3.4, the ribbon also reports itself to screen readers (wx``wx.USE_ACCESSIBILITY``), following the same keyboard model above: the tabs, pages, and the items within them are all exposed. This class supports the following styles: - ``wx.ribbon.RIBBON_BAR_DEFAULT_STYLE``: Defined as `wxRIBBON_BAR_FLOW_HORIZONTAL | ``wx.ribbon.RIBBON_BAR_SHOW_PAGE_LABELS`` | ``wx.ribbon.RIBBON_BAR_SHOW_PANEL_EXT_BUTTONS`` | ``wx.ribbon.RIBBON_BAR_SHOW_TOGGLE_BUTTON`` | ``wx.ribbon.RIBBON_BAR_SHOW_HELP_BUTTON`` -

Inheritance diagram of RibbonBar

| |appearance| Control Appearance =============================== | .. container:: control-appearance-figures .. figure:: _static/images/widgets/fullsize/wxmsw/../no_appearance.png :alt: wxMSW :figclass: appearance-figure **wxMSW** .. figure:: _static/images/widgets/fullsize/wxgtk/wx.ribbon.ribbonbar.png :alt: wxGTK :figclass: appearance-figure **wxGTK** .. figure:: _static/images/widgets/fullsize/wxmac/../no_appearance.png :alt: wxMAC :figclass: appearance-figure **wxMAC** | |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.ribbon.RibbonBar.__init__` Default constructor. :meth:`~wx.ribbon.RibbonBar.AddKeyTipsTriggerKey` Adds another key which shows KeyTips, keeping the existing ones. :meth:`~wx.ribbon.RibbonBar.AddPageHighlight` Highlight the specified tab. :meth:`~wx.ribbon.RibbonBar.AreKeyTipsShown` Returns ``True`` if keyboard access mode is currently active. :meth:`~wx.ribbon.RibbonBar.ArePanelsShown` Indicates whether the panel area of the ribbon bar is shown. :meth:`~wx.ribbon.RibbonBar.ClearKeyTipsTriggerKeys` Removes all trigger keys, disabling keyboard access mode. :meth:`~wx.ribbon.RibbonBar.ClearPages` Delete all pages from the ribbon bar. :meth:`~wx.ribbon.RibbonBar.Create` Create a ribbon bar in two-step ribbon bar construction. :meth:`~wx.ribbon.RibbonBar.DeletePage` Delete a single page from this ribbon bar. :meth:`~wx.ribbon.RibbonBar.DismissExpandedPanel` Dismiss the expanded panel of the currently active page. :meth:`~wx.ribbon.RibbonBar.GetActivePage` Get the index of the active page. :meth:`~wx.ribbon.RibbonBar.GetBackstagePage` Returns the page that acts as the File tab, or nullptr if there is none. :meth:`~wx.ribbon.RibbonBar.GetBackstageTabColour` Returns the colour of the File tab when it is styled. :meth:`~wx.ribbon.RibbonBar.GetButtonImageList` Return the image list containing images of the given size, creating it if necessary. :meth:`~wx.ribbon.RibbonBar.GetClassDefaultAttributes` :meth:`~wx.ribbon.RibbonBar.GetDisplayMode` Returns the current display mode of the panel area. :meth:`~wx.ribbon.RibbonBar.GetKeyTipsTriggerKeys` Returns the keys which show KeyTips. :meth:`~wx.ribbon.RibbonBar.GetPage` Get a page by index. :meth:`~wx.ribbon.RibbonBar.GetPageById` Get a page by window ``ID``. :meth:`~wx.ribbon.RibbonBar.GetPageCount` Get the number of pages in this bar. :meth:`~wx.ribbon.RibbonBar.GetPageNumber` Returns the number for a given ribbon bar page. :meth:`~wx.ribbon.RibbonBar.HasMultiplePages` Returns whether the bar contains multiple pages. :meth:`~wx.ribbon.RibbonBar.HideIfExpanded` Hide the panels if its display mode is ``RIBBON_BAR_EXPANDED`` . :meth:`~wx.ribbon.RibbonBar.HideKeyTips` Leaves keyboard access mode and hides the KeyTip badges. :meth:`~wx.ribbon.RibbonBar.HidePage` Hides the tab for a given page. :meth:`~wx.ribbon.RibbonBar.HidePanels` Hides the panel area of the ribbon bar. :meth:`~wx.ribbon.RibbonBar.IsBackstageShown` Returns ``True`` if the backstage is currently shown. :meth:`~wx.ribbon.RibbonBar.IsBackstageTabStyled` Returns ``True`` if the File tab is drawn in an accent colour. :meth:`~wx.ribbon.RibbonBar.IsPageHighlighted` Indicates whether a tab is currently highlighted. :meth:`~wx.ribbon.RibbonBar.IsPageShown` Indicates whether the tab for the given page is shown to the user or not. :meth:`~wx.ribbon.RibbonBar.Realize` Perform initial layout and size calculations of the bar and its children. :meth:`~wx.ribbon.RibbonBar.RemovePageHighlight` Changes a tab to not be highlighted. :meth:`~wx.ribbon.RibbonBar.SetActivePage` Set the active page by index, without triggering any events. :meth:`~wx.ribbon.RibbonBar.SetArtProvider` Set the art provider to be used be the ribbon bar. :meth:`~wx.ribbon.RibbonBar.SetBackstagePage` Sets the page that acts as the "File" tab of the backstage. :meth:`~wx.ribbon.RibbonBar.SetBackstageTabColour` Sets the colour of the File tab when it is styled. :meth:`~wx.ribbon.RibbonBar.SetHelpButtonKeyTip` Assigns the KeyTip used to activate the help button. :meth:`~wx.ribbon.RibbonBar.SetKeyTipsTriggerKey` Makes `keyCode` with `modifiers` the only key which shows KeyTips. :meth:`~wx.ribbon.RibbonBar.SetPageKeyTip` Assigns the KeyTip used to switch to the given page. :meth:`~wx.ribbon.RibbonBar.SetTabCtrlMargins` Set the margin widths (in pixels) on the left and right sides of the tab bar region of the ribbon bar. :meth:`~wx.ribbon.RibbonBar.SetToggleButtonKeyTip` Assigns the KeyTip used to activate the panel toggle button. :meth:`~wx.ribbon.RibbonBar.ShowBackstage` Shows or hides the backstage. :meth:`~wx.ribbon.RibbonBar.ShowKeyTips` Enters keyboard access mode and shows the KeyTip badges. :meth:`~wx.ribbon.RibbonBar.ShowPage` Show or hide the tab for a given page. :meth:`~wx.ribbon.RibbonBar.ShowPanels` Shows or hide the panel area of the ribbon bar according to the given display mode. :meth:`~wx.ribbon.RibbonBar.StyleBackstageTab` Sets whether the File tab is drawn in an accent colour. :meth:`~wx.ribbon.RibbonBar.UpdateBackstageColours` Applies the art provider's colours to the backstage. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.ribbon.RibbonBar.ActivePage` See :meth:`~wx.ribbon.RibbonBar.GetActivePage` and :meth:`~wx.ribbon.RibbonBar.SetActivePage` :attr:`~wx.ribbon.RibbonBar.BackstagePage` See :meth:`~wx.ribbon.RibbonBar.GetBackstagePage` and :meth:`~wx.ribbon.RibbonBar.SetBackstagePage` :attr:`~wx.ribbon.RibbonBar.BackstageTabColour` See :meth:`~wx.ribbon.RibbonBar.GetBackstageTabColour` and :meth:`~wx.ribbon.RibbonBar.SetBackstageTabColour` :attr:`~wx.ribbon.RibbonBar.DisplayMode` See :meth:`~wx.ribbon.RibbonBar.GetDisplayMode` :attr:`~wx.ribbon.RibbonBar.KeyTipsTriggerKeys` See :meth:`~wx.ribbon.RibbonBar.GetKeyTipsTriggerKeys` :attr:`~wx.ribbon.RibbonBar.PageCount` See :meth:`~wx.ribbon.RibbonBar.GetPageCount` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.ribbon.RibbonBar(RibbonControl) **Possible constructors**:: RibbonBar() -> None RibbonBar(parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=RIBBON_BAR_DEFAULT_STYLE) -> None Top-level control in a ribbon user interface. .. method:: __init__(self, *args, **kw) |overload| **Overloaded Implementations:** :html:`

` **__init__** `(self)` Default constructor. With this constructor, :meth:`Create` should be called in order to create the ribbon bar. :rtype: `None` :html:`

` **__init__** `(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=RIBBON_BAR_DEFAULT_STYLE)` Construct a ribbon bar with the given parameters. :param `parent`: :type `parent`: wx.Window :param `id`: :type `id`: wx.WindowID :param `pos`: :type `pos`: wx.Point :param `size`: :type `size`: wx.Size :param `style`: :type `style`: long :rtype: `None` :html:`

` .. method:: AddKeyTipsTriggerKey(self, keyCode, modifiers=MOD_NONE) Adds another key which shows KeyTips, keeping the existing ones. :param `keyCode`: :type `keyCode`: int :param `modifiers`: :type `modifiers`: int :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: AddPageHighlight(self, page, highlight=True) Highlight the specified tab. Highlighted tabs have a colour between that of the active tab and a tab over which the mouse is hovering. This can be used to make a tab (usually temporarily) more noticeable to the user. :param `page`: :type `page`: int :param `highlight`: :type `highlight`: bool :rtype: `None` .. versionadded:: 2.9.5 .. method:: AreKeyTipsShown(self) Returns ``True`` if keyboard access mode is currently active. :rtype: `bool` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: ArePanelsShown(self) Indicates whether the panel area of the ribbon bar is shown. :rtype: `bool` .. versionadded:: 2.9.2 .. seealso:: :meth:`ShowPanels` .. method:: ClearKeyTipsTriggerKeys(self) Removes all trigger keys, disabling keyboard access mode. It can still be entered programmatically with :meth:`ShowKeyTips` . :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: ClearPages(self) Delete all pages from the ribbon bar. :rtype: `None` .. versionadded:: 2.9.4 .. method:: Create(self, parent, id=ID_ANY, pos=DefaultPosition, size=DefaultSize, style=RIBBON_BAR_DEFAULT_STYLE) Create a ribbon bar in two-step ribbon bar construction. Should only be called when the default constructor is used, and arguments have the same meaning as in the full constructor. :param `parent`: :type `parent`: wx.Window :param `id`: :type `id`: wx.WindowID :param `pos`: :type `pos`: wx.Point :param `size`: :type `size`: wx.Size :param `style`: :type `style`: long :rtype: `bool` .. method:: DeletePage(self, n) Delete a single page from this ribbon bar. The user must call :meth:`wx.ribbon.RibbonBar.Realize` after one (or more) calls to this function. :param `n`: :type `n`: int :rtype: `None` .. versionadded:: 2.9.4 .. method:: DismissExpandedPanel(self) Dismiss the expanded panel of the currently active page. Calls and returns the value from :meth:`wx.ribbon.RibbonPage.DismissExpandedPanel` for the currently active page, or ``False`` if there is no active page. :rtype: `bool` .. method:: GetActivePage(self) Get the index of the active page. In the rare case of no page being active, -1 is returned. :rtype: `int` .. method:: GetBackstagePage(self) Returns the page that acts as the File tab, or nullptr if there is none. :rtype: :ref:`wx.ribbon.RibbonPage` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: GetBackstageTabColour(self) Returns the colour of the File tab when it is styled. :rtype: `Colour` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: GetButtonImageList(self, size, initialCount=1) Return the image list containing images of the given size, creating it if necessary. :param `size`: The size of the images going into this image list. :type `size`: wx.Size :param `initialCount`: The initial number of images to reserve for the image list (this parameter is available since wxWidgets 3.3.2). :type `initialCount`: int :rtype: `ImageList` :returns: The existing (or newly created) image list. .. versionadded:: 4.1/wxWidgets-3.1.4 .. staticmethod:: GetClassDefaultAttributes(variant=WINDOW_VARIANT_NORMAL) :param `variant`: :type `variant`: wx.WindowVariant :rtype: `VisualAttributes` .. method:: GetDisplayMode(self) Returns the current display mode of the panel area. :rtype: :ref:`wx.ribbon.RibbonDisplayMode` .. versionadded:: 4.1/wxWidgets-3.1.0 .. seealso:: :meth:`ShowPanels` .. method:: GetKeyTipsTriggerKeys(self) Returns the keys which show KeyTips. :rtype: `List[RibbonBar.TriggerKey]` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: GetPage(self, n) Get a page by index. nullptr will be returned if the given index is out of range. :param `n`: :type `n`: int :rtype: :ref:`wx.ribbon.RibbonPage` .. method:: GetPageById(self, id) Get a page by window ``ID``. nullptr will be returned if no page with the ``ID`` is found. :param `id`: :type `id`: wx.WindowID :rtype: :ref:`wx.ribbon.RibbonPage` .. versionadded:: 4.3/wxWidgets-3.3.0 .. method:: GetPageCount(self) Get the number of pages in this bar. :rtype: `int` .. versionadded:: 2.9.4 .. method:: GetPageNumber(self, page) Returns the number for a given ribbon bar page. The number can be used in other ribbon bar calls. :param `page`: :type `page`: wx.ribbon.RibbonPage :rtype: `int` .. versionadded:: 2.9.5 .. method:: HasMultiplePages(self) Returns whether the bar contains multiple pages. The default implementation always returns ``true`` . :rtype: `bool` .. method:: HideIfExpanded(self) Hide the panels if its display mode is ``RIBBON_BAR_EXPANDED`` . :rtype: `None` .. versionadded:: 2.9.5 .. method:: HideKeyTips(self) Leaves keyboard access mode and hides the KeyTip badges. Does nothing if the mode isn't active. :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: HidePage(self, page) Hides the tab for a given page. Equivalent to ``ShowPage(page, false)`` . :param `page`: :type `page`: int :rtype: `None` .. versionadded:: 2.9.5 .. method:: HidePanels(self) Hides the panel area of the ribbon bar. This method behaves like :meth:`ShowPanels` with ``False`` argument. :rtype: `None` .. versionadded:: 2.9.2 .. method:: IsBackstageShown(self) Returns ``True`` if the backstage is currently shown. :rtype: `bool` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: IsBackstageTabStyled(self) Returns ``True`` if the File tab is drawn in an accent colour. :rtype: `bool` .. versionadded:: 4.3/wxWidgets-3.3.4 .. seealso:: :meth:`StyleBackstageTab` .. method:: IsPageHighlighted(self, page) Indicates whether a tab is currently highlighted. :param `page`: :type `page`: int :rtype: `bool` .. versionadded:: 2.9.5 .. seealso:: :meth:`AddPageHighlight` .. method:: IsPageShown(self, page) Indicates whether the tab for the given page is shown to the user or not. By default all page tabs are shown. :param `page`: :type `page`: int :rtype: `bool` .. versionadded:: 2.9.5 .. method:: Realize(self) Perform initial layout and size calculations of the bar and its children. This must be called after all of the bar's children have been created (and their children created, etc.) - if it is not, then windows may not be laid out or sized correctly. Also calls :meth:`wx.ribbon.RibbonPage.Realize` on each child page. :rtype: `bool` .. method:: RemovePageHighlight(self, page) Changes a tab to not be highlighted. :param `page`: :type `page`: int :rtype: `None` .. versionadded:: 2.9.5 .. seealso:: :meth:`AddPageHighlight` .. method:: SetActivePage(self, *args, **kw) |overload| **Overloaded Implementations:** :html:`

` **SetActivePage** `(self, page)` Set the active page by index, without triggering any events. :param `page`: The zero-based index of the page to activate. :type `page`: int :rtype: `bool` :returns: ``True`` if the specified page is now active, ``False`` if it could not be activated (for example because the page index is invalid). :html:`

` **SetActivePage** `(self, page)` Set the active page, without triggering any events. :param `page`: The page to activate. :type `page`: wx.ribbon.RibbonPage :rtype: `bool` :returns: ``True`` if the specified page is now active, ``False`` if it could not be activated (for example because the given page is not a child of the ribbon bar). :html:`

` .. method:: SetArtProvider(self, art) Set the art provider to be used be the ribbon bar. Also sets the art provider on all current :ref:`wx.ribbon.RibbonPage` children, and any :ref:`wx.ribbon.RibbonPage` children added in the future. Note that unlike most other ribbon controls, the ribbon bar creates a default art provider when initialised, so an explicit call to :meth:`SetArtProvider` is not required if the default art provider is sufficient. Also, unlike other ribbon controls, the ribbon bar takes ownership of the given pointer, and will delete it when the art provider is changed or the bar is destroyed. If this behaviour is not desired, then clone the art provider before setting it. :param `art`: :type `art`: wx.ribbon.RibbonArtProvider :rtype: `None` .. method:: SetBackstagePage(self, page) Sets the page that acts as the "File" tab of the backstage. The page should not contain any panels. Only one page can be the File tab at a time. (Setting another one turns the previous page back into an ordinary tab.) If the backstage is currently shown, it is shown again from the new tab. The File tab is drawn in the system's accent colour (see :meth:`StyleBackstageTab` and :meth:`SetBackstageTabColour` ). :param `page`: The File tab's page, or nullptr to disable the backstage. :type `page`: wx.ribbon.RibbonPage :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. seealso:: :meth:`SetBackstage` , :meth:`ShowBackstage` .. method:: SetBackstageTabColour(self, colour) Sets the colour of the File tab when it is styled. :param `colour`: The colour, or an invalid colour to use the system's accent colour (the default). :type `colour`: wx.Colour :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: SetHelpButtonKeyTip(self, keytip) Assigns the KeyTip used to activate the help button. Only has an effect if the bar uses ``RIBBON_BAR_SHOW_HELP_BUTTON`` . :param `keytip`: :type `keytip`: string :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: SetKeyTipsTriggerKey(self, keyCode, modifiers=MOD_NONE) Makes `keyCode` with `modifiers` the only key which shows KeyTips. Replaces the default of ``WXK_F10`` with no modifiers. :param `keyCode`: :type `keyCode`: int :param `modifiers`: :type `modifiers`: int :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. seealso:: :meth:`AddKeyTipsTriggerKey` .. method:: SetPageKeyTip(self, *args, **kw) |overload| **Overloaded Implementations:** :html:`

` **SetPageKeyTip** `(self, page, keytip)` Assigns the KeyTip used to switch to the given page. Pass an empty string to remove it. The KeyTip is stored uppercased. :param `page`: :type `page`: int :param `keytip`: :type `keytip`: string :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. seealso:: `KeyTips` :html:`

` **SetPageKeyTip** `(self, page, keytip)` This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. :param `page`: :type `page`: wx.ribbon.RibbonPage :param `keytip`: :type `keytip`: string :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 :html:`

` .. method:: SetTabCtrlMargins(self, left, right) Set the margin widths (in pixels) on the left and right sides of the tab bar region of the ribbon bar. These margins will be painted with the tab background, but tabs and scroll buttons will never be painted in the margins. The left margin could be used for rendering something equivalent to the "Office Button", though this is not currently implemented. The right margin could be used for rendering a help button, and/or MDI buttons, but again, this is not currently implemented. :param `left`: :type `left`: int :param `right`: :type `right`: int :rtype: `None` .. method:: SetToggleButtonKeyTip(self, keytip) Assigns the KeyTip used to activate the panel toggle button. Only has an effect if the bar uses ``RIBBON_BAR_SHOW_TOGGLE_BUTTON`` . :param `keytip`: :type `keytip`: string :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: ShowBackstage(self, show=True) Shows or hides the backstage. Showing the backstage selects the File tab, collapses the panels, and swaps the content for the backstage. Hiding it selects the first other tab (if the File tab was selected), restores the display mode that the ribbon had, and brings back the content. Selecting the File tab or any other tab with the mouse or keyboard does this automatically. As the ribbon bar does not send a page changed event when a page is selected from code, use this function to show or hide the backstage programmatically. While the backstage is shown, the toggle button and double-clicking the File tab do nothing, and no ``wxEVT_RIBBONBAR_TOGGLED`` event is sent. :param `show`: :type `show`: bool :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. seealso:: :meth:`IsBackstageShown` .. method:: ShowKeyTips(self) Enters keyboard access mode and shows the KeyTip badges. :rtype: `bool` :returns: ``True`` if the mode was entered, ``False`` if the bar isn't shown on screen or no KeyTips are currently assigned to anything visible. .. versionadded:: 4.3/wxWidgets-3.3.4 .. seealso:: `KeyTips` .. method:: ShowPage(self, page, show_tab=True) Show or hide the tab for a given page. After showing or hiding a tab, you need to call :meth:`wx.ribbon.RibbonBar.Realize` . If you hide the tab for the currently active page (GetActivePage) then you should call SetActivePage to activate a different page. :param `page`: :type `page`: int :param `show_tab`: :type `show_tab`: bool :rtype: `None` .. versionadded:: 2.9.5 .. method:: ShowPanels(self, *args, **kw) |overload| **Overloaded Implementations:** :html:`

` **ShowPanels** `(self, mode)` Shows or hide the panel area of the ribbon bar according to the given display mode. :param `mode`: :type `mode`: wx.ribbon.RibbonDisplayMode :rtype: `None` .. versionadded:: 4.1/wxWidgets-3.1.0 :html:`

` **ShowPanels** `(self, show=True)` Shows or hides the panel area of the ribbon bar. If the panel area is hidden, then only the tab of the ribbon bar will be shown. This is useful for giving the user more screen space to work with when he/she doesn't need to see the ribbon's options. If the panel is currently shown, this method pins it, use the other overload of this method to specify the exact panel display mode to avoid it. :param `show`: :type `show`: bool :rtype: `None` .. versionadded:: 2.9.2 :html:`

` .. method:: StyleBackstageTab(self, style=True) Sets whether the File tab is drawn in an accent colour. If ``True`` (the default), the File tab is filled with the colour given by :meth:`GetBackstageTabColour` and its label is drawn in a contrasting colour. The fill has a glossy sheen, unless the art provider is `RibbonMSWFlatArtProvider` , in which case it is flat. If ``False``, the File tab is drawn like any other tab. :param `style`: :type `style`: bool :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. method:: UpdateBackstageColours(self) Applies the art provider's colours to the backstage. This is done automatically when the backstage or art provider is changed, and when the system colours change. Call it if the art provider's colours were changed afterwards. :rtype: `None` .. versionadded:: 4.3/wxWidgets-3.3.4 .. attribute:: ActivePage See :meth:`~wx.ribbon.RibbonBar.GetActivePage` and :meth:`~wx.ribbon.RibbonBar.SetActivePage` .. attribute:: BackstagePage See :meth:`~wx.ribbon.RibbonBar.GetBackstagePage` and :meth:`~wx.ribbon.RibbonBar.SetBackstagePage` .. attribute:: BackstageTabColour See :meth:`~wx.ribbon.RibbonBar.GetBackstageTabColour` and :meth:`~wx.ribbon.RibbonBar.SetBackstageTabColour` .. attribute:: DisplayMode See :meth:`~wx.ribbon.RibbonBar.GetDisplayMode` .. attribute:: KeyTipsTriggerKeys See :meth:`~wx.ribbon.RibbonBar.GetKeyTipsTriggerKeys` .. attribute:: PageCount See :meth:`~wx.ribbon.RibbonBar.GetPageCount`