Package wx :: Module _core :: Class App
[show private | hide private]
[frames | no frames]

Type App

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

Known Subclasses:
WizApp, XpApp

The ``wx.App`` class represents the application and is used to:

  * bootstrap the wxPython system and initialize the underlying
    gui toolkit
  * set and get application-wide properties
  * implement the windowing system main message or event loop,
    and to dispatch events to window instances
  * etc.

Every application must have a ``wx.App`` instance, and all
creation of UI objects should be delayed until after the
``wx.App`` object has been created in order to ensure that the gui
platform and wxWidgets have been fully initialized.

Normally you would derive from this class and implement an
``OnInit`` method that creates a frame and then calls
``self.SetTopWindow(frame)``.

:see: `wx.PySimpleApp` for a simpler app class that can be used
       directly.

Method Summary
  __init__(self, redirect, filename, useBestVisual, clearSigInt)
Construct a ``wx.App`` object.
  __del__(self)
  MainLoop(self)
Execute the main GUI event loop
  RedirectStdio(self, filename)
Redirect sys.stdout and sys.stderr to a file or a popup window.
  RestoreStdio(self)
  SetOutputWindowAttributes(self, title, pos, size)
Set the title, position and/or size of the output window if the stdio has been redirected.
  SetTopWindow(self, frame)
Set the "main" top level window
    Inherited from PyApp
  __repr__(self)
  _BootstrapApp(*args, **kwargs)
_BootstrapApp(self)
  _setCallbackInfo(*args, **kwargs)
_setCallbackInfo(self, PyObject self, PyObject _class)
  Dispatch(*args, **kwargs)
Dispatch(self) -> bool
  Exit(*args, **kwargs)
Exit(self)
  ExitMainLoop(*args, **kwargs)
ExitMainLoop(self)
  GetAppName(*args, **kwargs)
GetAppName(self) -> String
  GetAssertMode(*args, **kwargs)
GetAssertMode(self) -> int
  GetClassName(*args, **kwargs)
GetClassName(self) -> String
  GetComCtl32Version(*args, **kwargs)
GetComCtl32Version() -> int (Static method)
  GetExitOnFrameDelete(*args, **kwargs)
GetExitOnFrameDelete(self) -> bool
  GetMacAboutMenuItemId(*args, **kwargs)
GetMacAboutMenuItemId() -> long (Static method)
  GetMacExitMenuItemId(*args, **kwargs)
GetMacExitMenuItemId() -> long (Static method)
  GetMacHelpMenuTitleName(*args, **kwargs)
GetMacHelpMenuTitleName() -> String (Static method)
  GetMacPreferencesMenuItemId(*args, **kwargs)
GetMacPreferencesMenuItemId() -> long (Static method)
  GetMacSupportPCMenuShortcuts(*args, **kwargs)
GetMacSupportPCMenuShortcuts() -> bool (Static method)
  GetPrintMode(*args, **kwargs)
GetPrintMode(self) -> int
  GetTopWindow(*args, **kwargs)
GetTopWindow(self) -> Window
  GetTraits(*args, **kwargs)
GetTraits(self) -> wxAppTraits
  GetUseBestVisual(*args, **kwargs)
GetUseBestVisual(self) -> bool
  GetVendorName(*args, **kwargs)
GetVendorName(self) -> String
  IsActive(*args, **kwargs)
IsActive(self) -> bool
  IsMainLoopRunning(*args, **kwargs)
IsMainLoopRunning() -> bool (Static method)
  Pending(*args, **kwargs)
Pending(self) -> bool
  ProcessIdle(*args, **kwargs)
ProcessIdle(self) -> bool
  ProcessPendingEvents(*args, **kwargs)
ProcessPendingEvents(self)
  SendIdleEvents(*args, **kwargs)
SendIdleEvents(self, Window win, IdleEvent event) -> bool
  SetAppName(*args, **kwargs)
SetAppName(self, String name)
  SetAssertMode(*args, **kwargs)
SetAssertMode(self, int mode)
  SetClassName(*args, **kwargs)
SetClassName(self, String name)
  SetExitOnFrameDelete(*args, **kwargs)
SetExitOnFrameDelete(self, bool flag)
  SetMacAboutMenuItemId(*args, **kwargs)
SetMacAboutMenuItemId(long val) (Static method)
  SetMacExitMenuItemId(*args, **kwargs)
SetMacExitMenuItemId(long val) (Static method)
  SetMacHelpMenuTitleName(*args, **kwargs)
SetMacHelpMenuTitleName(String val) (Static method)
  SetMacPreferencesMenuItemId(*args, **kwargs)
SetMacPreferencesMenuItemId(long val) (Static method)
  SetMacSupportPCMenuShortcuts(*args, **kwargs)
SetMacSupportPCMenuShortcuts(bool val) (Static method)
  SetPrintMode(*args, **kwargs)
SetPrintMode(self, int mode)
  SetUseBestVisual(*args, **kwargs)
SetUseBestVisual(self, bool flag)
  SetVendorName(*args, **kwargs)
SetVendorName(self, String name)
  WakeUpIdle(*args, **kwargs)
WakeUpIdle(self)
  Yield(*args, **kwargs)
Yield(self, bool onlyIfNeeded=False) -> bool Process all currently pending events right now, instead of waiting until return to the event loop.
    Inherited from EvtHandler
  _setOORInfo(*args, **kwargs)
_setOORInfo(self, PyObject _self)
  AddPendingEvent(*args, **kwargs)
AddPendingEvent(self, Event event)
  Bind(self, event, handler, source, id, id2)
Bind an event to an event handler.
  Connect(*args, **kwargs)
Connect(self, int id, int lastId, int eventType, PyObject func)
  Disconnect(*args, **kwargs)
Disconnect(self, int id, int lastId=-1, wxEventType eventType=wxEVT_NULL) -> bool
  GetEvtHandlerEnabled(*args, **kwargs)
GetEvtHandlerEnabled(self) -> bool
  GetNextHandler(*args, **kwargs)
GetNextHandler(self) -> EvtHandler
  GetPreviousHandler(*args, **kwargs)
GetPreviousHandler(self) -> EvtHandler
  ProcessEvent(*args, **kwargs)
ProcessEvent(self, Event event) -> bool
  SetEvtHandlerEnabled(*args, **kwargs)
SetEvtHandlerEnabled(self, bool enabled)
  SetNextHandler(*args, **kwargs)
SetNextHandler(self, EvtHandler handler)
  SetPreviousHandler(*args, **kwargs)
SetPreviousHandler(self, EvtHandler handler)
  Unbind(self, event, source, id, id2)
Disconencts the event handler binding for event from self.
    Inherited from Object
  Destroy(*args, **kwargs)
Destroy(self)
    Inherited from object
  __delattr__(...)
x.__delattr__('name') <==> del x.name
  __getattribute__(...)
x.__getattribute__('name') <==> x.name
  __hash__(x)
x.__hash__() <==> hash(x)
  __new__(T, S, ...)
T.__new__(S, ...) -> a new object with type S, a subtype of T
  __reduce__(...)
helper for pickle
  __reduce_ex__(...)
helper for pickle
  __setattr__(...)
x.__setattr__('name', value) <==> x.name = value
  __str__(x)
x.__str__() <==> str(x)

Class Variable Summary
classobj outputWindowClass = wx._core.PyOnDemandOutputWindow
    Inherited from EvtHandler
Implements __implemented__ = <implementedBy wx._core.EvtHandler>
ClassProvides __provides__ = <zope.interface.declarations.ClassProvide...
    Inherited from Object
ClassProvides __providedBy__ = <zope.interface.declarations.ClassProvi...

Instance Method Details

__init__(self, redirect=False, filename=None, useBestVisual=False, clearSigInt=True)
(Constructor)

Construct a ``wx.App`` object.  

:param redirect: Should ``sys.stdout`` and ``sys.stderr`` be
    redirected?  Defaults to True on Windows and Mac, False
    otherwise.  If `filename` is None then output will be
    redirected to a window that pops up as needed.  (You can
    control what kind of window is created for the output by
    resetting the class variable ``outputWindowClass`` to a
    class of your choosing.)

:param filename: The name of a file to redirect output to, if
    redirect is True.

:param useBestVisual: Should the app try to use the best
    available visual provided by the system (only relevant on
    systems that have more than one visual.)  This parameter
    must be used instead of calling `SetUseBestVisual` later
    on because it must be set before the underlying GUI
    toolkit is initialized.

:param clearSigInt: Should SIGINT be cleared?  This allows the
    app to terminate upon a Ctrl-C in the console like other
    GUI apps will.

:note: You should override OnInit to do applicaition
    initialization to ensure that the system, toolkit and
    wxWidgets are fully initialized.
Overrides:
wx._core.PyApp.__init__

MainLoop(self)

Execute the main GUI event loop
Overrides:
wx._core.PyApp.MainLoop

RedirectStdio(self, filename=None)

Redirect sys.stdout and sys.stderr to a file or a popup window.

SetOutputWindowAttributes(self, title=None, pos=None, size=None)

Set the title, position and/or size of the output window if the stdio has been redirected. This should be called before any output would cause the output window to be created.

SetTopWindow(self, frame)

Set the "main" top level window
Overrides:
wx._core.PyApp.SetTopWindow

Generated by Epydoc 2.1 on Fri Jun 24 12:01:19 2005 http://epydoc.sf.net