Pmw.MegaToplevel() - base class for megawidgets within a toplevel
This class creates a megawidget contained within a toplevel window. It may be used directly to create a toplevel megawidget or it may be used as a base class for more specialised toplevel megawidgets, such as Pmw.Dialog. It creates a Tkinter.Toplevel component, named hull, to act as the container of the megawidget. The window class name for the hull widget is set to the most-specific class name for the megawidget. Derived classes specialise this widget by creating other widget components as children of the hull widget.
The megawidget may be used as either a normal toplevel window or
as a modal dialog. Use show()
and withdraw()
for normal use
and activate()
and deactivate()
for modal dialog use. If the
window is deleted by the window manager while being shown
normally, the default behaviour is to destroy the window. If the
window is deleted by the window manager while the window is active
(ie: when used as a modal dialog), the window is deactivated.
Use the userdeletefunc()
and usermodaldeletefunc()
methods to
override these behaviours. Do not call protocol()
to set the
WM_DELETE_WINDOW window manager protocol directly if you want to
use this window as a modal dialog.
The currently active windows form a stack with the most recently activated window at the top of the stack. All mouse and keyboard events are sent to this top window. When it deactivates, the next window in the stack will start to receive events.
activate()
. The default is None.
deactivate()
method is called.
If globalMode is 0, the window will grab control of the pointer and keyboard, preventing any events from being delivered to any other toplevel windows within the application. If globalMode is 1, the grab will prevent events from being delivered to any other toplevel windows regardless of application. Global grabs should be used sparingly.
When the window is displayed, it is is centred on the screen. Also, if the BLT Tcl extension library is present, a clock cursor will be displayed until the window is deactivated.
If the activatecommand option is callable, it is called just before the window begins to wait for the result.
If master is not None, the window will become a transient window of master. The master should should be another existing toplevel window.
activate()
is currently waiting for a result to be passed to it
by a call to deactivate()
). Otherwise, return 0.
activate()
is waiting. It
will withdraw the window, release the grab and cause the
activate()
call to return with the value of result.
withdraw()
then
show()
will not move the window, whereas calling withdraw()
then deiconify()
may change the window's position. (This may
depend on the behaviour of the window manager.)
self.destroy
.
self.deactivate
.
Home. Pmw 0.6.2 Maintainer gregm@iname.com. 23 Feb 1998