.. wxPython Phoenix documentation This file was generated by Phoenix's sphinx generator and associated tools, do not edit by hand. Copyright: (c) 2011-2020 by Total Control Software License: wxWindows License .. include:: headings.inc .. _wx.DarkModeSettings: ========================================================================================================================================== |phoenix_title| **wx.DarkModeSettings** ========================================================================================================================================== Allows to customize some of the settings used in MSW dark mode. An object of this class may be passed to :meth:`wx.App.MSWEnableDarkMode ` to customize some aspects of the dark mode when it is used under MSW systems. For example, to customize the background colour to use a reddish black instead of normal black used by default, you could do the following: .. versionadded:: 4.3/wxWidgets-3.3.0 | |class_hierarchy| Class Hierarchy ================================= .. raw:: html
Inheritance diagram for class DarkModeSettings:
| |method_summary| Methods Summary ================================ ================================================================================ ================================================================================ :meth:`~wx.DarkModeSettings.__init__` Default constructor does nothing. :meth:`~wx.DarkModeSettings.GetBorderPen` Get the pen to use for drawing :ref:`wx.StaticBox` border in dark mode. :meth:`~wx.DarkModeSettings.GetColour` Get the colour to use for the given system colour when dark mode is on. :meth:`~wx.DarkModeSettings.GetMenuColour` Get the colour to use for the menu bar in the given state. ================================================================================ ================================================================================ | |property_summary| Properties Summary ===================================== ================================================================================ ================================================================================ :attr:`~wx.DarkModeSettings.BorderPen` See :meth:`~wx.DarkModeSettings.GetBorderPen` ================================================================================ ================================================================================ | |api| Class API =============== .. class:: wx.DarkModeSettings(object) **Possible constructors**:: DarkModeSettings() -> None Allows to customize some of the settings used in MSW dark mode. .. method:: __init__(self) Default constructor does nothing. :rtype: `None` .. method:: GetBorderPen(self) Get the pen to use for drawing :ref:`wx.StaticBox` border in dark mode. Returning an invalid pen indicates that the default border drawn by the system should be used, which doesn't look very well in dark mode but shouldn't result in any problems worse than cosmetic ones. The base class version returns a grey pen, which looks better than the default white one. :rtype: :ref:`wx.Pen` .. method:: GetColour(self, index) Get the colour to use for the given system colour when dark mode is on. The base class version of this function returns the colours commonly used in dark mode. As the rest of dark mode support, their exact values are not documented and are subject to change in the future Windows or wxWidgets versions. :param `index`: :type `index`: wx.SystemColour :rtype: :ref:`wx.Colour` .. seealso:: :meth:`GetMenuColour` .. method:: GetMenuColour(self, which) Get the colour to use for the menu bar in the given state. Currently the colours used by the menus in the menu bar in dark mode don't correspond to any of SystemColour values and this separate function is used for customizing them instead of :meth:`GetColour` . Note that the colours returned by this function only affect the top level menus, the colours of the menu items inside them can be customized in the usual way using `OwnerDrawn.SetTextColour().` The returned colour must be valid. :param `which`: :type `which`: wx.MenuColour :rtype: :ref:`wx.Colour` .. attribute:: BorderPen See :meth:`~wx.DarkModeSettings.GetBorderPen`