next up previous contents index
Next: 15.13.2 Window Objects Up: 15.13 Standard module FrameWork Previous: 15.13 Standard module FrameWork

15.13.1 Application objects

Application objects have the following methods, among others:

makeusermenus()
Override this method if you need menus in your application. Append the menus to self.menubar.

getabouttext()
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])
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). While raising self to exit the mainloop is still supported it is not recommended, call self._quit instead.

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.

_quit()
Terminate the event mainloop at the next convenient moment.

do_char(c, event)
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)
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).

idle(event)
Called by the main event loop when no events are available. The null-event is passed (so you can look at mouse position, etc).



guido@cnri.reston.va.us