| 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="dialogwindow-objects.html" /> |
| 13 | <link rel="prev" href="controlswindow-object.html" /> |
| 14 | <link rel="parent" href="module-FrameWork.html" /> |
| 15 | <link rel="next" href="dialogwindow-objects.html" /> |
| 16 | <meta name='aesop' content='information' /> |
| 17 | <title>2.8.4 ScrolledWindow Object </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.3 ControlsWindow Object" |
| 25 | href="controlswindow-object.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.5 DialogWindow Objects" |
| 31 | href="dialogwindow-objects.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="controlswindow-object.html">2.8.3 ControlsWindow Object</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="dialogwindow-objects.html">2.8.5 DialogWindow Objects</A> |
| 50 | </div> |
| 51 | <hr /></div> |
| 52 | </DIV> |
| 53 | <!--End of Navigation Panel--> |
| 54 | |
| 55 | <H2><A NAME="SECTION004840000000000000000"></A><A NAME="scrolledwindow-object"></A> |
| 56 | <BR> |
| 57 | 2.8.4 ScrolledWindow Object |
| 58 | </H2> |
| 59 | |
| 60 | <P> |
| 61 | ScrolledWindow objects are ControlsWindow objects with the following |
| 62 | extra methods: |
| 63 | |
| 64 | <P> |
| 65 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 66 | <td><nobr><b><tt id='l2h-124' xml:id='l2h-124' class="method">scrollbars</tt></b>(</nobr></td> |
| 67 | <td><var></var><big>[</big><var>wantx</var><big>[</big><var>, |
| 68 | wanty</var><big>]</big><var></var><big>]</big><var></var>)</td></tr></table></dt> |
| 69 | <dd> |
| 70 | Create (or destroy) horizontal and vertical scrollbars. The arguments |
| 71 | specify which you want (default: both). The scrollbars always have |
| 72 | minimum <code>0</code> and maximum <code>32767</code>. |
| 73 | </dl> |
| 74 | |
| 75 | <P> |
| 76 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 77 | <td><nobr><b><tt id='l2h-125' xml:id='l2h-125' class="method">getscrollbarvalues</tt></b>(</nobr></td> |
| 78 | <td><var></var>)</td></tr></table></dt> |
| 79 | <dd> |
| 80 | You must supply this method. It should return a tuple <code>(<var>x</var>, |
| 81 | <var>y</var>)</code> giving the current position of the scrollbars (between |
| 82 | <code>0</code> and <code>32767</code>). You can return <code>None</code> for either to |
| 83 | indicate the whole document is visible in that direction. |
| 84 | </dl> |
| 85 | |
| 86 | <P> |
| 87 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 88 | <td><nobr><b><tt id='l2h-126' xml:id='l2h-126' class="method">updatescrollbars</tt></b>(</nobr></td> |
| 89 | <td><var></var>)</td></tr></table></dt> |
| 90 | <dd> |
| 91 | Call this method when the document has changed. It will call |
| 92 | <tt class="method">getscrollbarvalues()</tt> and update the scrollbars. |
| 93 | </dl> |
| 94 | |
| 95 | <P> |
| 96 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 97 | <td><nobr><b><tt id='l2h-127' xml:id='l2h-127' class="method">scrollbar_callback</tt></b>(</nobr></td> |
| 98 | <td><var>which, what, value</var>)</td></tr></table></dt> |
| 99 | <dd> |
| 100 | Supplied by you and called after user interaction. <var>which</var> will |
| 101 | be <code>'x'</code> or <code>'y'</code>, <var>what</var> will be <code>'-'</code>, |
| 102 | <code>'--'</code>, <code>'set'</code>, <code>'++'</code> or <code>'+'</code>. For |
| 103 | <code>'set'</code>, <var>value</var> will contain the new scrollbar position. |
| 104 | </dl> |
| 105 | |
| 106 | <P> |
| 107 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 108 | <td><nobr><b><tt id='l2h-128' xml:id='l2h-128' class="method">scalebarvalues</tt></b>(</nobr></td> |
| 109 | <td><var>absmin, absmax, |
| 110 | curmin, curmax</var>)</td></tr></table></dt> |
| 111 | <dd> |
| 112 | Auxiliary method to help you calculate values to return from |
| 113 | <tt class="method">getscrollbarvalues()</tt>. You pass document minimum and maximum value |
| 114 | and topmost (leftmost) and bottommost (rightmost) visible values and |
| 115 | it returns the correct number or <code>None</code>. |
| 116 | </dl> |
| 117 | |
| 118 | <P> |
| 119 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 120 | <td><nobr><b><tt id='l2h-129' xml:id='l2h-129' class="method">do_activate</tt></b>(</nobr></td> |
| 121 | <td><var>onoff, event</var>)</td></tr></table></dt> |
| 122 | <dd> |
| 123 | Takes care of dimming/highlighting scrollbars when a window becomes |
| 124 | frontmost. If you override this method, call this one at the end of |
| 125 | your method. |
| 126 | </dl> |
| 127 | |
| 128 | <P> |
| 129 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 130 | <td><nobr><b><tt id='l2h-130' xml:id='l2h-130' class="method">do_postresize</tt></b>(</nobr></td> |
| 131 | <td><var>width, height, window</var>)</td></tr></table></dt> |
| 132 | <dd> |
| 133 | Moves scrollbars to the correct position. Call this method initially |
| 134 | if you override it. |
| 135 | </dl> |
| 136 | |
| 137 | <P> |
| 138 | <dl><dt><table cellpadding="0" cellspacing="0"><tr valign="baseline"> |
| 139 | <td><nobr><b><tt id='l2h-131' xml:id='l2h-131' class="method">do_controlhit</tt></b>(</nobr></td> |
| 140 | <td><var>window, control, |
| 141 | pcode, event</var>)</td></tr></table></dt> |
| 142 | <dd> |
| 143 | Handles scrollbar interaction. If you override it call this method |
| 144 | first, a nonzero return value indicates the hit was in the scrollbars |
| 145 | and has been handled. |
| 146 | </dl> |
| 147 | |
| 148 | <P> |
| 149 | |
| 150 | <DIV CLASS="navigation"> |
| 151 | <div class='online-navigation'> |
| 152 | <p></p><hr /> |
| 153 | <table align="center" width="100%" cellpadding="0" cellspacing="2"> |
| 154 | <tr> |
| 155 | <td class='online-navigation'><a rel="prev" title="2.8.3 ControlsWindow Object" |
| 156 | href="controlswindow-object.html"><img src='../icons/previous.png' |
| 157 | border='0' height='32' alt='Previous Page' width='32' /></A></td> |
| 158 | <td class='online-navigation'><a rel="parent" title="2.8 FrameWork " |
| 159 | href="module-FrameWork.html"><img src='../icons/up.png' |
| 160 | border='0' height='32' alt='Up One Level' width='32' /></A></td> |
| 161 | <td class='online-navigation'><a rel="next" title="2.8.5 DialogWindow Objects" |
| 162 | href="dialogwindow-objects.html"><img src='../icons/next.png' |
| 163 | border='0' height='32' alt='Next Page' width='32' /></A></td> |
| 164 | <td align="center" width="100%">Macintosh Library Modules</td> |
| 165 | <td class='online-navigation'><a rel="contents" title="Table of Contents" |
| 166 | href="contents.html"><img src='../icons/contents.png' |
| 167 | border='0' height='32' alt='Contents' width='32' /></A></td> |
| 168 | <td class='online-navigation'><a href="modindex.html" title="Module Index"><img src='../icons/modules.png' |
| 169 | border='0' height='32' alt='Module Index' width='32' /></a></td> |
| 170 | <td class='online-navigation'><a rel="index" title="Index" |
| 171 | href="genindex.html"><img src='../icons/index.png' |
| 172 | border='0' height='32' alt='Index' width='32' /></A></td> |
| 173 | </tr></table> |
| 174 | <div class='online-navigation'> |
| 175 | <b class="navlabel">Previous:</b> |
| 176 | <a class="sectref" rel="prev" href="controlswindow-object.html">2.8.3 ControlsWindow Object</A> |
| 177 | <b class="navlabel">Up:</b> |
| 178 | <a class="sectref" rel="parent" href="module-FrameWork.html">2.8 FrameWork </A> |
| 179 | <b class="navlabel">Next:</b> |
| 180 | <a class="sectref" rel="next" href="dialogwindow-objects.html">2.8.5 DialogWindow Objects</A> |
| 181 | </div> |
| 182 | </div> |
| 183 | <hr /> |
| 184 | <span class="release-info">Release 2.4.2, documentation updated on 28 September 2005.</span> |
| 185 | </DIV> |
| 186 | <!--End of Navigation Panel--> |
| 187 | <ADDRESS> |
| 188 | See <i><a href="about.html">About this document...</a></i> for information on suggesting changes. |
| 189 | </ADDRESS> |
| 190 | </BODY> |
| 191 | </HTML> |