Application objects -- Python library reference



Next: Window Objects Prev: FrameWork Up: FrameWork Top: Top

14.12.1. Application objects

Application objects have the following methods, among others:

makeusermenus () -- Method on Application
Override this method if you need menus in your application. Append the menus to self.menubar.
getabouttext () -- Method on Application
Override this method to return a text string describing your application. Alternatively, override the do_about method for more elaborate about messages.
mainloop ([mask, wait]) -- Method on Application
This routine is the main event loop, call it to set your application rolling. Mask is the mask of events you want to handle, wait is the number of ticks you want to leave to other concurrent application (default 0, which is probably not a good idea). This method does not return until self is raised.

The event loop is split into many small parts, each of which can be overridden. The default methods take care of dispatching events to windows and dialogs, handling drags and resizes, Apple Events, events for non-FrameWork windows, etc.

do_char (c, event) -- Method on Application
The user typed character c. The complete details of the event can be found in the event structure. This method can also be provided in a Window object, which overrides the application-wide handler if the window is frontmost.
do_dialogevent (event) -- Method on Application
Called early in the event loop to handle modeless dialog events. The default method simply dispatches the event to the relevant dialog (not through the the DialogWindow object involved). Override if you need special handling of dialog events (keyboard shortcuts, etc).


Next: Window Objects Prev: FrameWork Up: FrameWork Top: Top