| 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| 2 | <html> |
| 3 | <head> |
| 4 | <link rel="STYLESHEET" href="mac.css" type='text/css' /> |
| 5 | <link rel="SHORTCUT ICON" href="../icons/pyfav.png" type="image/png" /> |
| 6 | <link rel='start' href='../index.html' title='Python Documentation Index' /> |
| 7 | <link rel="first" href="mac.html" title='Macintosh Library Modules' /> |
| 8 | <link rel='contents' href='contents.html' title="Contents" /> |
| 9 | <link rel='index' href='genindex.html' title='Index' /> |
| 10 | <link rel='last' href='about.html' title='About this document...' /> |
| 11 | <link rel='help' href='about.html' title='About this document...' /> |
| 12 | <link rel="next" href="controlswindow-object.html" /> |
| 13 | <link rel="prev" href="application-objects.html" /> |
| 14 | <link rel="parent" href="module-FrameWork.html" /> |
| 15 | <link rel="next" href="controlswindow-object.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>2.8.2 Window Objects </title> |
| 18 | </head> |
| 19 | <body> |
| 20 | <DIV CLASS="navigation"> |
| 21 | <div id='top-navigation-panel' xml:id='top-navigation-panel'> |
| 22 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 23 | <tr> |
| 24 | <td class='online-navigation'><a rel="prev" title="2.8.1 Application Objects" |
| 25 | href="application-objects.html"><img src='../icons/previous.png' |
| 26 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 27 | <td class='online-navigation'><a rel="parent" title="2.8 FrameWork " |
| 28 | href="module-FrameWork.html"><img src='../icons/up.png' |
| 29 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 30 | <td class='online-navigation'><a rel="next" title="2.8.3 ControlsWindow Object" |
| 31 | href="controlswindow-object.html"><img src='../icons/next.png' |
| 32 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 33 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 34 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 35 | href="contents.html"><img src='../icons/contents.png' |
| 36 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 37 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 38 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 39 | <td class='online-navigation'><a rel="index" title="Index" |
| 40 | href="genindex.html"><img src='../icons/index.png' |
| 41 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 42 | </tr></table> |
| 43 | <div class='online-navigation'> |
| 44 | <b class="navlabel">Previous:</b> |
| 45 | <a class="sectref" rel="prev" href="application-objects.html">2.8.1 Application Objects</A> |
| 46 | <b class="navlabel">Up:</b> |
| 47 | <a class="sectref" rel="parent" href="module-FrameWork.html">2.8 FrameWork </A> |
| 48 | <b class="navlabel">Next:</b> |
| 49 | <a class="sectref" rel="next" href="controlswindow-object.html">2.8.3 ControlsWindow Object</A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H2><A NAME="SECTION004820000000000000000"></A><A NAME="window-objects"></A> |
| 56 | <BR> |
| 57 | 2.8.2 Window Objects |
| 58 | </H2> |
| 59 | |
| 60 | <P> |
| 61 | Window objects have the following methods, among others: |
| 62 | |
| 63 | <P> |
| 64 | |
| 65 | <P> |
| 66 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 67 | <td><nobr><b><tt id='l2h-117' xml:id='l2h-117' class="method">open</tt></b>(</nobr></td> |
| 68 | <td><var></var>)</td></tr></table></dt> |
| 69 | <dd> |
| 70 | Override this method to open a window. Store the MacOS window-id in |
| 71 | <tt class="member">self.wid</tt> and call the <tt class="method">do_postopen()</tt> method to |
| 72 | register the window with the parent application. |
| 73 | </dl> |
| 74 | |
| 75 | <P> |
| 76 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 77 | <td><nobr><b><tt id='l2h-118' xml:id='l2h-118' class="method">close</tt></b>(</nobr></td> |
| 78 | <td><var></var>)</td></tr></table></dt> |
| 79 | <dd> |
| 80 | Override this method to do any special processing on window |
| 81 | close. Call the <tt class="method">do_postclose()</tt> method to cleanup the parent |
| 82 | state. |
| 83 | </dl> |
| 84 | |
| 85 | <P> |
| 86 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 87 | <td><nobr><b><tt id='l2h-119' xml:id='l2h-119' class="method">do_postresize</tt></b>(</nobr></td> |
| 88 | <td><var>width, height, macoswindowid</var>)</td></tr></table></dt> |
| 89 | <dd> |
| 90 | Called after the window is resized. Override if more needs to be done |
| 91 | than calling <code>InvalRect</code>. |
| 92 | </dl> |
| 93 | |
| 94 | <P> |
| 95 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 96 | <td><nobr><b><tt id='l2h-120' xml:id='l2h-120' class="method">do_contentclick</tt></b>(</nobr></td> |
| 97 | <td><var>local, modifiers, event</var>)</td></tr></table></dt> |
| 98 | <dd> |
| 99 | The user clicked in the content part of a window. The arguments are |
| 100 | the coordinates (window-relative), the key modifiers and the raw |
| 101 | event. |
| 102 | </dl> |
| 103 | |
| 104 | <P> |
| 105 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 106 | <td><nobr><b><tt id='l2h-121' xml:id='l2h-121' class="method">do_update</tt></b>(</nobr></td> |
| 107 | <td><var>macoswindowid, event</var>)</td></tr></table></dt> |
| 108 | <dd> |
| 109 | An update event for the window was received. Redraw the window. |
| 110 | </dl> |
| 111 | |
| 112 | <P> |
| 113 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 114 | <td><nobr><b><tt id='l2h-122' xml:id='l2h-122' class="method">do_activate</tt></b>(</nobr></td> |
| 115 | <td><var>activate, event</var>)</td></tr></table></dt> |
| 116 | <dd> |
| 117 | The window was activated (<code><var>activate</var> == 1</code>) or deactivated |
| 118 | (<code><var>activate</var> == 0</code>). Handle things like focus highlighting, |
| 119 | etc. |
| 120 | </dl> |
| 121 | |
| 122 | <P> |
| 123 | |
| 124 | <DIV CLASS="navigation"> |
| 125 | <div class='online-navigation'> |
| 126 | <p></p><hr /> |
| 127 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 128 | <tr> |
| 129 | <td class='online-navigation'><a rel="prev" title="2.8.1 Application Objects" |
| 130 | href="application-objects.html"><img src='../icons/previous.png' |
| 131 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 132 | <td class='online-navigation'><a rel="parent" title="2.8 FrameWork " |
| 133 | href="module-FrameWork.html"><img src='../icons/up.png' |
| 134 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 135 | <td class='online-navigation'><a rel="next" title="2.8.3 ControlsWindow Object" |
| 136 | href="controlswindow-object.html"><img src='../icons/next.png' |
| 137 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 138 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 139 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 140 | href="contents.html"><img src='../icons/contents.png' |
| 141 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 142 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 143 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 144 | <td class='online-navigation'><a rel="index" title="Index" |
| 145 | href="genindex.html"><img src='../icons/index.png' |
| 146 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 147 | </tr></table> |
| 148 | <div class='online-navigation'> |
| 149 | <b class="navlabel">Previous:</b> |
| 150 | <a class="sectref" rel="prev" href="application-objects.html">2.8.1 Application Objects</A> |
| 151 | <b class="navlabel">Up:</b> |
| 152 | <a class="sectref" rel="parent" href="module-FrameWork.html">2.8 FrameWork </A> |
| 153 | <b class="navlabel">Next:</b> |
| 154 | <a class="sectref" rel="next" href="controlswindow-object.html">2.8.3 ControlsWindow Object</A> |
| 155 | </div> |
| 156 | </div> |
| 157 | <hr /> |
| 158 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 159 | </DIV> |
| 160 | <!--End of Navigation Panel--> |
| 161 | <ADDRESS> |
| 162 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 163 | </ADDRESS> |
| 164 | </BODY> |
| 165 | </HTML> |