1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200
|
<html>
<head>
<title>Pmw.MegaToplevel reference manual</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ee"
vlink="551a8b" alink="ff0000">
<center><P ALIGN="CENTER">
<IMG SRC = transdove.gif ALT = "" WIDTH=70 HEIGHT=75>
<IMG SRC = transdove.gif ALT = "" WIDTH=70 HEIGHT=75>
<IMG SRC = transdove.gif ALT = "" WIDTH=70 HEIGHT=75>
</p></center>
<h1 ALIGN="CENTER">Pmw.MegaToplevel</h1>
<p>
<dl>
<dt> <h3>Name</h3><dd>
<p>Pmw.MegaToplevel() -
base class for megawidgets within a toplevel
</p>
<dt> <h3>Inherits</h3><dd>
<a href="MegaArchetype.html">Pmw.MegaArchetype</a><br>
<dt> <h3>Description</h3><dd>
<p>
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 <a href="Dialog.html">Pmw.Dialog</a>. It creates a Tkinter.Toplevel
component, named <strong>hull</strong>, to act as the container of the megawidget.
The window class name for the <strong>hull</strong> 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 <strong>hull</strong> widget.</p>
<p> The megawidget may be used as either a normal toplevel window or
as a modal dialog. Use <code>show()</code> and <code>withdraw()</code> for normal use
and <code>activate()</code> and <code>deactivate()</code> 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 <code>userdeletefunc()</code> and <code>usermodaldeletefunc()</code> methods to
override these behaviours. Do not call <code>protocol()</code> to set the
<strong>WM_DELETE_WINDOW</strong> window manager protocol directly if you want to
use this window as a modal dialog.</p>
<p> 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.</p>
<p></p>
<dt> <h3>Options</h3><dd>
Options for this megawidget and its base
classes are described below.<p>
<a name=option.activatecommand></a>
<dl><dt> <strong>activatecommand
</strong><dd>
If this is callable, it will be called whenever the megawidget is
activated by a call to <code>activate()</code>. The default is <strong>None</strong>.</p>
</dt></dl>
<a name=option.title></a>
<dl><dt> <strong>title
</strong><dd>
This is the title that the window manager displays in the title
bar of the window. The default is <strong>None</strong>.</p>
</dt></dl>
<dt> <h3>Components</h3><dd>
Components created by this megawidget and its base
classes are described below.<p>
<a name=component.hull></a>
<dl><dt> <strong>hull
</strong><dd>
This acts as the body for the entire megawidget. Other components
are created as children of the hull to further specialise the
widget. By default, this component is a Tkinter.Toplevel.</p>
</dt></dl>
<a name=methods></a>
<dt> <h3>Methods</h3><dd>
Only methods specific to this megawidget are described below.
For a description of its inherited methods, see the
manuals for its base classes.
In addition, methods from
<strong>Tkinter.Toplevel</strong> are forwarded
to this megawidget's <strong>hull</strong>
component.
<p>
<a name=method.activate></a>
<dl><dt> <strong>activate</strong>(<em>globalMode</em> = <strong>0</strong>, <em>master</em> = <strong>None</strong>)<dd>
Display the window, perform a grab operation and wait for the
result. The window will be withdrawn, the grab released and the
result returned when the <code>deactivate()</code> method is called.</p>
<p> If <em>globalMode</em> is <strong>0</strong>, 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
<em>globalMode</em> is <strong>1</strong>, the grab will prevent events from being
delivered to any other toplevel windows regardless of application.
Global grabs should be used sparingly.</p>
<p> When the window is displayed, it is is centred on the screen.
Also, if the <strong>BLT</strong> Tcl extension library is present, a <strong>clock</strong>
cursor will be displayed until the window is deactivated.</p>
<p> If the <strong>activatecommand</strong> option is callable, it is called just
before the window begins to wait for the result.</p>
<p> If <em>master</em> is not <strong>None</strong>, the window will become a transient
window of <em>master</em>. The <em>master</em> should should be another
existing toplevel window.</p>
</dt></dl>
<a name=method.active></a>
<dl><dt> <strong>active</strong>()<dd>
Return <strong>1</strong> if the megawidget is currently active (that is,
<code>activate()</code> is currently waiting for a result to be passed to it
by a call to <code>deactivate()</code>). Otherwise, return <strong>0</strong>.</p>
</dt></dl>
<a name=method.deactivate></a>
<dl><dt> <strong>deactivate</strong>(<em>result</em> = <strong>None</strong>)<dd>
This should be called while a call to <code>activate()</code> is waiting. It
will withdraw the window, release the grab and cause the
<code>activate()</code> call to return with the value of <em>result</em>.</p>
</dt></dl>
<a name=method.destroy></a>
<dl><dt> <strong>destroy</strong>()<dd>
Destroy the <strong>hull</strong> component widget, including all of its
children. If the megawidget is currently active, deactivate it.</p>
</dt></dl>
<a name=method.show></a>
<dl><dt> <strong>show</strong>()<dd>
Make the window visible. This raises or deiconifies the toplevel
window. If the window has previously been shown it will remain in
the same position. This means that calling <code>withdraw()</code> then
<code>show()</code> will not move the window, whereas calling <code>withdraw()</code>
then <code>deiconify()</code> may change the window's position. (This may
depend on the behaviour of the window manager.)</p>
</dt></dl>
<a name=method.userdeletefunc></a>
<dl><dt> <strong>userdeletefunc</strong>(<em>func</em> = <strong>None</strong>)<dd>
If <em>func</em> is <strong>None</strong>, return the function that will be called
when the window is deleted by the window manager while being
displayed normally. If <em>func</em> is not <strong>None</strong>, set this function to
<em>func</em>. By default, the function is <code>self.destroy</code>.</p>
</dt></dl>
<a name=method.usermodaldeletefunc></a>
<dl><dt> <strong>usermodaldeletefunc</strong>(<em>func</em> = <strong>None</strong>)<dd>
If <em>func</em> is <strong>None</strong>, return the function that will be called
when the window is deleted by the window manager while it is
active (ie: when being used as a modal dialog). If <em>func</em> is not
<strong>None</strong>, set this function to <em>func</em>. By default, the function is
<code>self.deactivate</code>.</p>
</dt></dl>
</dl>
<center><P ALIGN="CENTER">
<IMG SRC = blue_line.gif ALT = "" WIDTH=320 HEIGHT=5>
</p></center>
<font size=-1>
<center><P ALIGN="CENTER">
<a href="index.html">Home</a>.
Pmw 0.6.2
Maintainer
<a href="mailto:gregm@iname.com">gregm@iname.com</a>.
23 Feb 1998
</p></center>
</font>
</body>
</html>
|