<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<!--Converted with LaTeX2HTML 98.2 beta6 (August 14th, 1998)
original version by:  Nikos Drakos, CBLU, University of Leeds
* revised and updated by:  Marcus Hennecke, Ross Moore, Herb Swan
* with significant contributions from:
  Jens Lippmann, Marek Rouchal, Martin Wilck and others -->
<HTML>
<HEAD>
<TITLE>15.4 ScrolledWindow Object </TITLE>
<META NAME="description" CONTENT="15.4 ScrolledWindow Object ">
<META NAME="keywords" CONTENT="mac">
<META NAME="resource-type" CONTENT="document">
<META NAME="distribution" CONTENT="global">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<LINK REL="STYLESHEET" HREF="mac.css">
<LINK REL="next" HREF="dialogwindow-objects.html">
<LINK REL="previous" HREF="controlswindow-object.html">
<LINK REL="up" HREF="module-FrameWork.html">
<LINK REL="next" HREF="dialogwindow-objects.html">
</HEAD>
<BODY bgcolor="#ffffff">
<div class=navigation>
<table align=center width="100%" cellpadding=0 cellspacing=2>
<tr>
<td><A HREF="dialogwindow-objects.html"><img width=32 height=32 align=bottom border=0 alt="next"
 src="../icons/next.gif"></A></td>
<td><A HREF="module-FrameWork.html"><img width=32 height=32 align=bottom border=0 alt="up"
 src="../icons/up.gif"></A></td>
<td><A HREF="controlswindow-object.html"><img width=32 height=32 align=bottom border=0 alt="previous"
 src="../icons/previous.gif"></A></td>
<td align=center bgcolor="#99CCFF" width="100%">
 <b class=title>Macintosh Library Modules</b></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="contents"
 src="../icons/contents.gif"></A></td>
<td><a
 href="modindex.html"><img width=32 height=32 align=bottom border=0 alt="modules"
 src="../icons/modules.gif"></a></td>
<td><A HREF="genindex.html"><img width=32 height=32 align=bottom border=0 alt="index"
 src="../icons/index.gif"></A></td>
</tr></table><b class=navlabel>Next:</b> <span class=sectref><A HREF="dialogwindow-objects.html">15.5 DialogWindow Objects</A></span>
<b class=navlabel>Up:</b> <span class=sectref><A HREF="module-FrameWork.html">15. FrameWork  </A></span>
<b class=navlabel>Previous:</b> <span class=sectref><A HREF="controlswindow-object.html">15.3 ControlsWindow Object</A></span>
<br><hr></div>
<!--End of Navigation Panel-->

<H2><A NAME="SECTION0021540000000000000000"></A>
<BR>
15.4 ScrolledWindow Object 
</H2>

<P>
ScrolledWindow objects are ControlsWindow objects with the following
extra methods:

<P>
<dl><dt><b><a name="l2h-248"><tt class=method>scrollbars</tt></a></b> (<big>[</big><var>wantx</var><big>[</big><var>,
                                               wanty</var><big>]</big><big>]</big>)
<dd>
Create (or destroy) horizontal and vertical scrollbars. The arguments
specify which you want (default: both). The scrollbars always have
minimum <tt>0</tt> and maximum <tt>32767</tt>.
</dl>

<P>
<dl><dt><b><a name="l2h-249"><tt class=method>getscrollbarvalues</tt></a></b> ()
<dd>
You must supply this method. It should return a tuple <tt>(<var>x</var>,
<var>y</var>)</tt> giving the current position of the scrollbars (between
<tt>0</tt> and <tt>32767</tt>). You can return <tt>None</tt> for either to
indicate the whole document is visible in that direction.
</dl>

<P>
<dl><dt><b><a name="l2h-250"><tt class=method>updatescrollbars</tt></a></b> ()
<dd>
Call this method when the document has changed. It will call
<tt class=method>getscrollbarvalues()</tt> and update the scrollbars.
</dl>

<P>
<dl><dt><b><a name="l2h-251"><tt class=method>scrollbar_callback</tt></a></b> (<var>which, what, value</var>)
<dd>
Supplied by you and called after user interaction. <var>which</var> will
be <tt>'x'</tt> or <tt>'y'</tt>, <var>what</var> will be <tt>'-'</tt>,
<tt>'-'</tt>, <tt>'set'</tt>, <tt>'++'</tt> or <tt>'+'</tt>. For
<tt>'set'</tt>, <var>value</var> will contain the new scrollbar position.
</dl>

<P>
<dl><dt><b><a name="l2h-252"><tt class=method>scalebarvalues</tt></a></b> (<var>absmin, absmax,
                                                   curmin, curmax</var>)
<dd>
Auxiliary method to help you calculate values to return from
<tt class=method>getscrollbarvalues()</tt>. You pass document minimum and maximum value
and topmost (leftmost) and bottommost (rightmost) visible values and
it returns the correct number or <tt>None</tt>.
</dl>

<P>
<dl><dt><b><a name="l2h-253"><tt class=method>do_activate</tt></a></b> (<var>onoff, event</var>)
<dd>
Takes care of dimming/highlighting scrollbars when a window becomes
frontmost vv. If you override this method call this one at the end of
your method.
</dl>

<P>
<dl><dt><b><a name="l2h-254"><tt class=method>do_postresize</tt></a></b> (<var>width, height, window</var>)
<dd>
Moves scrollbars to the correct position. Call this method initially
if you override it.
</dl>

<P>
<dl><dt><b><a name="l2h-255"><tt class=method>do_controlhit</tt></a></b> (<var>window, control,
                                                  pcode, event</var>)
<dd>
Handles scrollbar interaction. If you override it call this method
first, a nonzero return value indicates the hit was in the scrollbars
and has been handled.
</dl>

<P>
<p>
<div class=navigation><hr><table align=center width="100%" cellpadding=0 cellspacing=2>
<tr>
<td><A HREF="dialogwindow-objects.html"><img width=32 height=32 align=bottom border=0 alt="next"
 src="../icons/next.gif"></A></td>
<td><A HREF="module-FrameWork.html"><img width=32 height=32 align=bottom border=0 alt="up"
 src="../icons/up.gif"></A></td>
<td><A HREF="controlswindow-object.html"><img width=32 height=32 align=bottom border=0 alt="previous"
 src="../icons/previous.gif"></A></td>
<td align=center bgcolor="#99CCFF" width="100%">
 <b class=title>Macintosh Library Modules</b></td>
<td><A HREF="contents.html"><img width=32 height=32 align=bottom border=0 alt="contents"
 src="../icons/contents.gif"></A></td>
<td><a
 href="modindex.html"><img width=32 height=32 align=bottom border=0 alt="modules"
 src="../icons/modules.gif"></a></td>
<td><A HREF="genindex.html"><img width=32 height=32 align=bottom border=0 alt="index"
 src="../icons/index.gif"></A></td>
</tr></table><b class=navlabel>Next:</b> <span class=sectref><A HREF="dialogwindow-objects.html">15.5 DialogWindow Objects</A></span>
<b class=navlabel>Up:</b> <span class=sectref><A HREF="module-FrameWork.html">15. FrameWork  </A></span>
<b class=navlabel>Previous:</b> <span class=sectref><A HREF="controlswindow-object.html">15.3 ControlsWindow Object</A></span>
</div>
<!--End of Navigation Panel-->
<ADDRESS>
<hr>Send comments on this document to <a href="mailto:python-docs@python.org">python-docs@python.org</a>.
</ADDRESS>
</BODY>
</HTML>
