******** wx.PyApp ******** Inheritance diagram for `wx.PyApp`: | .. inheritance-diagram:: wx.PyApp | Description =========== The `wx.PyApp` class is an \*implementation detail\*, please use the `wx.App `_ class (or some other derived class) instead. Derived From ^^^^^^^^^^^^^ * `wx.EvtHandler `_ * `wx.Object `_ Known Subclasses ^^^^^^^^^^^^^^^^ `wx.App `_, `wx.PySimpleApp `_, `wx.PyWidgetTester `_ Methods Summary ^^^^^^^^^^^^^^^ * `__init__ <#__init__>`_ * `Dispatch <#Dispatch>`_ * `Exit <#Exit>`_ * `ExitMainLoop <#ExitMainLoop>`_ * `GetAppName <#GetAppName>`_ * `GetAssertMode <#GetAssertMode>`_ * `GetComCtl32Version <#GetComCtl32Version>`_ * `GetExitOnFrameDelete <#GetExitOnFrameDelete>`_ * `GetLayoutDirection <#GetLayoutDirection>`_ * `GetMacAboutMenuItemId <#GetMacAboutMenuItemId>`_ * `GetMacExitMenuItemId <#GetMacExitMenuItemId>`_ * `GetMacHelpMenuTitleName <#GetMacHelpMenuTitleName>`_ * `GetMacPreferencesMenuItemId <#GetMacPreferencesMenuItemId>`_ * `GetMacSupportPCMenuShortcuts <#GetMacSupportPCMenuShortcuts>`_ * `GetPrintMode <#GetPrintMode>`_ * `GetTopWindow <#GetTopWindow>`_ * `GetTraits <#GetTraits>`_ * `GetUseBestVisual <#GetUseBestVisual>`_ * `GetVendorName <#GetVendorName>`_ * `IsActive <#IsActive>`_ * `IsDisplayAvailable <#IsDisplayAvailable>`_ * `IsMainLoopRunning <#IsMainLoopRunning>`_ * `MacHideApp <#MacHideApp>`_ * `MacRequestUserAttention <#MacRequestUserAttention>`_ * `MainLoop <#MainLoop>`_ * `Pending <#Pending>`_ * `ProcessIdle <#ProcessIdle>`_ * `SendIdleEvents <#SendIdleEvents>`_ * `SetAppName <#SetAppName>`_ * `SetAssertMode <#SetAssertMode>`_ * `SetClassName <#SetClassName>`_ * `SetExitOnFrameDelete <#SetExitOnFrameDelete>`_ * `SetMacAboutMenuItemId <#SetMacAboutMenuItemId>`_ * `SetMacExitMenuItemId <#SetMacExitMenuItemId>`_ * `SetMacHelpMenuTitleName <#SetMacHelpMenuTitleName>`_ * `SetMacPreferencesMenuItemId <#SetMacPreferencesMenuItemId>`_ * `SetMacSupportPCMenuShortcuts <#SetMacSupportPCMenuShortcuts>`_ * `SetPrintMode <#SetPrintMode>`_ * `SetTopWindow <#SetTopWindow>`_ * `SetUseBestVisual <#SetUseBestVisual>`_ * `SetVendorName <#SetVendorName>`_ * `WakeUpIdle <#WakeUpIdle>`_ * `Yield <#Yield>`_ Properties Summary ^^^^^^^^^^^^^^^^^^ * `Active <#Active>`_ * `AppName <#AppName>`_ * `AssertMode <#AssertMode>`_ * `ExitOnFrameDelete <#ExitOnFrameDelete>`_ * `LayoutDirection <#LayoutDirection>`_ * `PrintMode <#PrintMode>`_ * `TopWindow <#TopWindow>`_ * `Traits <#Traits>`_ * `UseBestVisual <#UseBestVisual>`_ * `VendorName <#VendorName>`_ Class API ========= Methods ^^^^^^^ .. method:: __init__() Create a new application object, starting the bootstrap process. | **Returns:** `wx.PyApp `_ -------- .. method:: Dispatch() Process the first event in the event queue (blocks until an event appears if there are none currently). | **Returns:** `bool` -------- .. method:: Exit() Exit the main loop thus terminating the application. .. seealso:: `wx.Exit <../wxFunctions.html#Exit>`_ -------- .. method:: ExitMainLoop() Exit the main GUI loop during the next iteration of the main loop, (i.e. it does not stop the program immediately!). -------- .. method:: GetAppName() Get the application name. | **Returns:** `string` -------- .. method:: GetAssertMode() Get the current OnAssert behaviour setting. | **Returns:** `int` -------- .. method:: GetComCtl32Version() Returns 400, 470, 471, etc. for comctl32.dll 4.00, 4.70, 4.71 or 0 if it wasn't found at all. Raises an exception on non-Windows platforms. | **Returns:** `int` -------- .. method:: GetExitOnFrameDelete() Get the current exit behaviour setting. | **Returns:** `bool` -------- .. method:: GetLayoutDirection() Return the layout direction for the current locale. | **Returns:** `int` -------- .. method:: GetMacAboutMenuItemId() `No docstrings available for this method.` -------- .. method:: GetMacExitMenuItemId() `No docstrings available for this method.` -------- .. method:: GetMacHelpMenuTitleName() `No docstrings available for this method.` -------- .. method:: GetMacPreferencesMenuItemId() `No docstrings available for this method.` -------- .. method:: GetMacSupportPCMenuShortcuts() `No docstrings available for this method.` -------- .. method:: GetPrintMode() `No docstrings available for this method.` -------- .. method:: GetTopWindow() Return the **main** top level window (if it hadn't been set previously with `SetTopWindow <#SetTopWindow>`_, will return just some top level window and, if there not any, will return ``None``) | **Returns:** `wx.Window `_ -------- .. method:: GetTraits() Return (and create if necessary) the app traits object to which we delegate for everything which either should be configurable by the user (then he can change the default behaviour simply by overriding `CreateTraits` and returning his own traits object) or which is GUI/console dependent as then `wx.AppTraits` allows us to abstract the differences behind the common facade. | **Returns:** `wx.AppTraits` :todo: Add support for overriding `CreateAppTraits` in wxPython. -------- .. method:: GetUseBestVisual() Get current `UseBestVisual` setting. | **Returns:** `bool` -------- .. method:: GetVendorName() Get the application's vendor name. | **Returns:** `string` -------- .. method:: IsActive() Return ``True`` if our app has focus. | **Returns:** `bool` -------- .. method:: IsDisplayAvailable() Tests if it is possible to create a GUI in the current environment. This will mean different things on the different platforms: * On X Windows systems this function will return ``False`` if it is not able to open a connection to the X display, which can happen if $DISPLAY is not set, or is not set correctly. * On Mac OS X a ``False`` return value will mean that wxPython is not able to access the window manager, which can happen if logged in remotely or if running from the normal version of python instead of the framework version (i.e., ``pythonw``). * On MS Windows... | **Returns:** `bool` -------- .. method:: IsMainLoopRunning() Returns ``True`` if we're running the main loop, i.e. if the events can currently be dispatched. | **Returns:** `bool` -------- .. method:: MacHideApp() Hide all application windows just as the user can do with the system Hide command. Mac only. -------- .. method:: MacRequestUserAttention() `No docstrings available for this method.` -------- .. method:: MainLoop() Execute the main GUI loop, the function doesn't normally return until all top level windows have been closed and destroyed. | **Returns:** `int` -------- .. method:: Pending() Returns ``True`` if there are unprocessed events in the event queue. | **Returns:** `bool` -------- .. method:: ProcessIdle() Called from the MainLoop when the application becomes idle (there are no pending events) and sends a `wx.IdleEvent <../Events/wx.IdleEvent.html>`_ to all interested parties. Returns ``True`` if more idle events are needed, ``False`` if not. | **Returns:** `bool` -------- .. method:: SendIdleEvents(win, event) Send idle event to window and all subwindows. Returns ``True`` if more idle time is requested. **Parameters:** * `win` (`wx.Window `_) * `event` (`wx.IdleEvent <../Events/wx.IdleEvent.html>`_) | **Returns:** `bool` -------- .. method:: SetAppName(name) Set the application name. This value may be used automatically by `wx.Config `_ and such. **Parameters:** * `name` (string) -------- .. method:: SetAssertMode(mode) Set the `OnAssert` behaviour for debug and hybrid builds. **Parameters:** * `mode` (int) -------- .. method:: SetClassName(name) Set the application's class name. This value may be used for X-resources if applicable for the platform **Parameters:** * `name` (string) -------- .. method:: SetExitOnFrameDelete(flag) Control the exit behaviour: by default, the program will exit the main loop (and so, usually, terminate) when the last top-level program window is deleted. Beware that if you disable this behaviour (with `SetExitOnFrameDelete` (``False``)), you'll have to call `ExitMainLoop <#ExitMainLoop>`_ explicitly from somewhere. **Parameters:** * `flag` (bool) -------- .. method:: SetMacAboutMenuItemId(val) | **Parameters:** * `val` (long) -------- .. method:: SetMacExitMenuItemId(val) | **Parameters:** * `val` (long) -------- .. method:: SetMacHelpMenuTitleName(val) | **Parameters:** * `val` (string) -------- .. method:: SetMacPreferencesMenuItemId(val) | **Parameters:** * `val` (long) -------- .. method:: SetMacSupportPCMenuShortcuts(val) | **Parameters:** * `val` (bool) -------- .. method:: SetPrintMode(mode) | **Parameters:** * `mode` (int) -------- .. method:: SetTopWindow(win) Set the **main** top level window. **Parameters:** * `win` (`wx.Window `_) -------- .. method:: SetUseBestVisual(flag, forceTrueColour=False) Set whether the app should try to use the best available visual on systems where more than one is available (Sun, SGI, XFree86 4, etc...) **Parameters:** * `flag` (bool) * `forceTrueColour` (bool) -------- .. method:: SetVendorName(name) Set the application's vendor name. This value may be used automatically by `wx.Config `_ and such. **Parameters:** * `name` (string) -------- .. method:: WakeUpIdle() Make sure that idle events are sent again. .. seealso:: `wx.WakeUpIdle <../wxFunctions.html#WakeUpIdle>`_ -------- .. method:: Yield(onlyIfNeeded=False) Process all currently pending events right now, instead of waiting until return to the event loop. It is an error to call `Yield` recursively unless the value of `onlyIfNeeded` is ``True``. **Parameters:** * `onlyIfNeeded` (bool) | **Returns:** `bool` .. warning:: This function is dangerous as it can lead to unexpected reentrancies (i.e. when called from an event handler it may result in calling the same event handler again), use with extreme care or, better, don't use at all! .. seealso:: `wx.Yield <../wxFunctions.html#Yield>`_, `wx.YieldIfNeeded <../wxFunctions.html#YieldIfNeeded>`_, `wx.SafeYield <../wxFunctions.html#SafeYield>`_ -------- Properties ^^^^^^^^^^ .. attribute:: Active Return ``True`` if our app has focus. .. attribute:: AppName See `GetAppName <#GetAppName>`_ and `SetAppName <#SetAppName>`_ .. attribute:: AssertMode See `GetAssertMode <#GetAssertMode>`_ and `SetAssertMode <#SetAssertMode>`_ .. attribute:: ExitOnFrameDelete See `GetExitOnFrameDelete <#GetExitOnFrameDelete>`_ and `SetExitOnFrameDelete <#SetExitOnFrameDelete>`_ .. attribute:: LayoutDirection See `GetLayoutDirection <#GetLayoutDirection>`_ .. attribute:: PrintMode See `GetPrintMode <#GetPrintMode>`_ and `SetPrintMode <#SetPrintMode>`_ .. attribute:: TopWindow See `GetTopWindow <#GetTopWindow>`_ and `SetTopWindow <#SetTopWindow>`_ .. attribute:: Traits See `GetTraits <#GetTraits>`_ .. attribute:: UseBestVisual See `GetUseBestVisual <#GetUseBestVisual>`_ and `SetUseBestVisual <#SetUseBestVisual>`_ .. attribute:: VendorName See `GetVendorName <#GetVendorName>`_ and `SetVendorName <#SetVendorName>`_