Package wx :: Class PyApp
[frames | no frames]

Type PyApp

object --+        
         |        
    Object --+    
             |    
    EvtHandler --+
                 |
                PyApp

Known Subclasses:
App

The wx.PyApp class is an implementation detail, please use the wx.App class (or some other derived class) instead.


Method Summary
PyApp __init__(self)
Create a new application object, starting the bootstrap process.
  __del__(self)
bool Dispatch(self)
Process the first event in the event queue (blocks until an event appears if there are none currently)
  Exit(self)
Exit the main loop thus terminating the application.
  ExitMainLoop(self)
Exit the main GUI loop during the next iteration of the main loop, (i.e.
String GetAppName(self)
Get the application name.
int GetAssertMode(self)
Get the current OnAssert behaviour setting.
String GetClassName(self)
Get the application's class name.
int GetComCtl32Version()
Returns 400, 470, 471, etc. (Static method)
bool GetExitOnFrameDelete(self)
Get the current exit behaviour setting.
int GetLayoutDirection(self)
Return the layout direction for the current locale.
long GetMacAboutMenuItemId()
(Static method)
long GetMacExitMenuItemId()
(Static method)
String GetMacHelpMenuTitleName()
(Static method)
long GetMacPreferencesMenuItemId()
(Static method)
bool GetMacSupportPCMenuShortcuts()
(Static method)
int GetPrintMode(self)
Window GetTopWindow(self)
Return the main top level window (if it hadn't been set previously with SetTopWindow(), will return just some top level window and, if there not any, will return None)
wxAppTraits GetTraits(self)
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.
bool GetUseBestVisual(self)
Get current UseBestVisual setting.
String GetVendorName(self)
Get the application's vendor name.
bool IsActive(self)
Return True if our app has focus.
bool IsDisplayAvailable()
Tests if it is possible to create a GUI in the current environment. (Static method)
bool IsMainLoopRunning()
Returns True if we're running the main loop, i.e. (Static method)
  MacHideApp(self)
Hide all application windows just as the user can do with the system Hide command.
  MacRequestUserAttention(*args, **kwargs)
MacRequestUserAttention(self, int ?)
int MainLoop(self)
Execute the main GUI loop, the function doesn't normally return until all top level windows have been closed and destroyed.
bool Pending(self)
Returns True if there are unprocessed events in the event queue.
bool ProcessIdle(self)
Called from the MainLoop when the application becomes idle (there are no pending events) and sends a wx.IdleEvent to all interested parties.
  ProcessPendingEvents(self)
Process all events in the Pending Events list -- it is necessary to call this function to process posted events.
bool SendIdleEvents(self, win, event)
Send idle event to window and all subwindows.
  SetAppName(self, name)
Set the application name.
  SetAssertMode(self, mode)
Set the OnAssert behaviour for debug and hybrid builds.The following flags may be or'd together:
  SetClassName(self, name)
Set the application's class name.
  SetExitOnFrameDelete(self, 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.
  SetMacAboutMenuItemId(val)
(Static method)
  SetMacExitMenuItemId(val)
(Static method)
  SetMacHelpMenuTitleName(val)
(Static method)
  SetMacPreferencesMenuItemId(val)
(Static method)
  SetMacSupportPCMenuShortcuts(val)
(Static method)
  SetPrintMode(self, mode)
  SetTopWindow(self, win)
Set the main top level window
  SetUseBestVisual(self, flag, forceTrueColour)
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.)
  SetVendorName(self, name)
Set the application's vendor name.
  WakeUpIdle(self)
Make sure that idle events are sent again.
bool Yield(self, onlyIfNeeded)
Process all currently pending events right now, instead of waiting until return to the event loop.

Property Summary
  Active: IsActive(self) -> bool
  AppName: See GetAppName and SetAppName
  AssertMode: See GetAssertMode and SetAssertMode
  ClassName: See GetClassName and SetClassName
  ExitOnFrameDelete: See GetExitOnFrameDelete and SetExitOnFrameDelete
  LayoutDirection: See GetLayoutDirection
  PrintMode: See GetPrintMode and SetPrintMode
  thisown: The membership flag
  TopWindow: See GetTopWindow and SetTopWindow
  Traits: See GetTraits
  UseBestVisual: See GetUseBestVisual and SetUseBestVisual
  VendorName: See GetVendorName and SetVendorName

Instance Method Details

__init__(self)
(Constructor)

Create a new application object, starting the bootstrap process.

Returns:
PyApp
Overrides:
wx.EvtHandler.__init__

Dispatch(self)

Process the first event in the event queue (blocks until an event appears if there are none currently)

Returns:
bool

Exit(self)

Exit the main loop thus terminating the application. :see: wx.Exit

ExitMainLoop(self)

Exit the main GUI loop during the next iteration of the main loop, (i.e. it does not stop the program immediately!)

GetAppName(self)

Get the application name.

Returns:
String

GetAssertMode(self)

Get the current OnAssert behaviour setting.

Returns:
int

GetClassName(self)

Get the application's class name.

Returns:
String
Overrides:
wx.Object.GetClassName

GetExitOnFrameDelete(self)

Get the current exit behaviour setting.

Returns:
bool

GetLayoutDirection(self)

Return the layout direction for the current locale.

Returns:
int

GetTopWindow(self)

Return the main top level window (if it hadn't been set previously with SetTopWindow(), will return just some top level window and, if there not any, will return None)

Returns:
Window

GetTraits(self)

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:
wxAppTraits

To Do:

Add support for overriding CreateAppTraits in wxPython.

GetUseBestVisual(self)

Get current UseBestVisual setting.

Returns:
bool

GetVendorName(self)

Get the application's vendor name.

Returns:
String

IsActive(self)

Return True if our app has focus.

Returns:
bool

MacHideApp(self)

Hide all application windows just as the user can do with the system Hide command. Mac only.

MacRequestUserAttention(*args, **kwargs)

MacRequestUserAttention(self, int ?)

MainLoop(self)

Execute the main GUI loop, the function doesn't normally return until all top level windows have been closed and destroyed.

Returns:
int

Pending(self)

Returns True if there are unprocessed events in the event queue.

Returns:
bool

ProcessIdle(self)

Called from the MainLoop when the application becomes idle (there are no pending events) and sends a wx.IdleEvent to all interested parties. Returns True if more idle events are needed, False if not.

Returns:
bool

ProcessPendingEvents(self)

Process all events in the Pending Events list -- it is necessary to call this function to process posted events. This normally happens during each event loop iteration.

Overrides:
wx.EvtHandler.ProcessPendingEvents

SendIdleEvents(self, win, event)

Send idle event to window and all subwindows. Returns True if more idle time is requested.

Parameters:
win
           (type=Window)

event
           (type=IdleEvent)

Returns:
bool

SetAppName(self, name)

Set the application name. This value may be used automatically by wx.Config and such.

Parameters:
name
           (type=String)

SetAssertMode(self, mode)

Set the OnAssert behaviour for debug and hybrid builds.The following flags may be or'd together:

wx.PYAPP_ASSERT_SUPPRESS Don't do anything
wx.PYAPP_ASSERT_EXCEPTION Turn it into a Python exception if possible (default)
wx.PYAPP_ASSERT_DIALOG Display a message dialog
wx.PYAPP_ASSERT_LOG Write the assertion info to the wx.Log
Parameters:
mode
           (type=int)

SetClassName(self, name)

Set the application's class name. This value may be used for X-resources if applicable for the platform

Parameters:
name
           (type=String)

SetExitOnFrameDelete(self, 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() explicitly from somewhere.

Parameters:
flag
           (type=bool)

SetTopWindow(self, win)

Set the main top level window

Parameters:
win
           (type=Window)

SetUseBestVisual(self, 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
           (type=bool)

forceTrueColour
           (type=bool)

SetVendorName(self, name)

Set the application's vendor name. This value may be used automatically by wx.Config and such.

Parameters:
name
           (type=String)

WakeUpIdle(self)

Make sure that idle events are sent again. :see: wx.WakeUpIdle

Yield(self, 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
           (type=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!

See Also:

wx.Yield, wx.YieldIfNeeded, wx.SafeYield


Static Method Details

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

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 wx 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

IsMainLoopRunning()

Returns True if we're running the main loop, i.e. if the events can currently be dispatched.

Returns:
bool

Property Details

Active

IsActive(self) -> bool

Return True if our app has focus.

Get Method:
IsActive(self)

AppName

See GetAppName and SetAppName

Get Method:
GetAppName(self)
Set Method:
SetAppName(self, name)

AssertMode

See GetAssertMode and SetAssertMode

Get Method:
GetAssertMode(self)
Set Method:
SetAssertMode(self, mode)

ClassName

See GetClassName and SetClassName

Get Method:
GetClassName(self)
Set Method:
SetClassName(self, name)

ExitOnFrameDelete

See GetExitOnFrameDelete and SetExitOnFrameDelete

Get Method:
GetExitOnFrameDelete(self)
Set Method:
SetExitOnFrameDelete(self, flag)

LayoutDirection

See GetLayoutDirection

Get Method:
GetLayoutDirection(self)

PrintMode

See GetPrintMode and SetPrintMode

Get Method:
GetPrintMode(self)
Set Method:
SetPrintMode(self, mode)

thisown

The membership flag

TopWindow

See GetTopWindow and SetTopWindow

Get Method:
GetTopWindow(self)
Set Method:
SetTopWindow(self, win)

Traits

See GetTraits

Get Method:
GetTraits(self)

UseBestVisual

See GetUseBestVisual and SetUseBestVisual

Get Method:
GetUseBestVisual(self)
Set Method:
SetUseBestVisual(self, flag, forceTrueColour)

VendorName

See GetVendorName and SetVendorName

Get Method:
GetVendorName(self)
Set Method:
SetVendorName(self, name)

Generated by Epydoc 2.1.20050511.rpd on Mon Feb 16 12:52:00 2009 http://epydoc.sf.net