1998-08-10 18:40:22 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\section{\module{FrameWork} ---
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								         Interactive application framework}
							 | 
						
					
						
							
								
									
										
										
										
											1998-07-23 17:55:31 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\declaremodule{standard}{FrameWork}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								  \platform{Mac}
							 | 
						
					
						
							
								
									
										
										
										
											1998-07-23 17:55:31 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\modulesynopsis{Interactive application framework.}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The \module{FrameWork} module contains classes that together provide a
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								framework for an interactive Macintosh application. The programmer
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								builds an application by creating subclasses that override various
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								methods of the bases classes, thereby implementing the functionality
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								wanted. Overriding functionality can often be done on various
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								different levels, i.e. to handle clicks in a single dialog window in a
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								non-standard way it is not necessary to override the complete event
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								handling.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The \module{FrameWork} is still very much work-in-progress, and the
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								documentation describes only the most important functionality, and not
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								in the most logical manner at that. Examine the source or the examples
							 | 
						
					
						
							
								
									
										
										
										
											2000-10-14 04:53:31 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								for more details.  The following are some comments posted on the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								MacPython newsgroup about the strengths and limitations of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\module{FrameWork}:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\begin{quotation}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The strong point of \module{FrameWork} is that it allows you to break
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								into the control-flow at many different places. \refmodule{W}, for
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								instance, uses a different way to enable/disable menus and that plugs
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								right in leaving the rest intact.  The weak points of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\module{FrameWork} are that it has no abstract command interface (but
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								that shouldn't be difficult), that it's dialog support is minimal and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								that it's control/toolbar support is non-existent.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{quotation}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The \module{FrameWork} module defines the following functions:
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{Application}{}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								An object representing the complete application. See below for a
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								description of the methods. The default \method{__init__()} routine
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								creates an empty window dictionary and a menu bar with an apple menu.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{MenuBar}{}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								An object representing the menubar. This object is usually not created
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								by the user.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-03-17 06:33:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{Menu}{bar, title\optional{, after}}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								An object representing a menu. Upon creation you pass the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\code{MenuBar} the menu appears in, the \var{title} string and a
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								position (1-based) \var{after} where the menu should appear (default:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								at the end).
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-03-17 06:33:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{MenuItem}{menu, title\optional{, shortcut, callback}}
							 | 
						
					
						
							
								
									
										
										
										
											2000-10-14 04:53:31 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Create a menu item object. The arguments are the menu to create, the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								item item title string and optionally the keyboard shortcut
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								and a callback routine. The callback is called with the arguments
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								menu-id, item number within menu (1-based), current front window and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								the event record.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2000-10-14 04:53:31 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Instead of a callable object the callback can also be a string. In
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								this case menu selection causes the lookup of a method in the topmost
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								window and the application. The method name is the callback string
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								with \code{'domenu_'} prepended.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Calling the \code{MenuBar} \method{fixmenudimstate()} method sets the
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								correct dimming for all menu items based on the current front window.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{Separator}{menu}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Add a separator to the end of a menu.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-03-17 06:33:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{SubMenu}{menu, label}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Create a submenu named \var{label} under menu \var{menu}. The menu
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								object is returned.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{Window}{parent}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Creates a (modeless) window. \var{Parent} is the application object to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								which the window belongs. The window is not displayed until later.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{DialogWindow}{parent}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Creates a modeless dialog window.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-03-17 06:33:25 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{windowbounds}{width, height}
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Return a \code{(\var{left}, \var{top}, \var{right}, \var{bottom})}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								tuple suitable for creation of a window of given width and height. The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								window will be staggered with respect to previous windows, and an
							 | 
						
					
						
							
								
									
										
										
										
											2000-10-14 04:53:31 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								attempt is made to keep the whole window on-screen. However, the window will
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								however always be the exact size given, so parts may be offscreen.
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{setwatchcursor}{}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Set the mouse cursor to a watch.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\begin{funcdesc}{setarrowcursor}{}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Set the mouse cursor to an arrow.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{funcdesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\subsection{Application Objects \label{application-objects}}
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Application objects have the following methods, among others:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Application]{makeusermenus}{}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Override this method if you need menus in your application. Append the
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								menus to the attribute \member{menubar}.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Application]{getabouttext}{}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Override this method to return a text string describing your
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								application.  Alternatively, override the \method{do_about()} method
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								for more elaborate ``about'' messages.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Application]{mainloop}{\optional{mask\optional{, wait}}}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								This routine is the main event loop, call it to set your application
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								rolling. \var{Mask} is the mask of events you want to handle,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\var{wait} is the number of ticks you want to leave to other
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								concurrent application (default 0, which is probably not a good
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								idea). While raising \var{self} to exit the mainloop is still
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								supported it is not recommended: call \code{self._quit()} instead.
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The event loop is split into many small parts, each of which can be
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								overridden. The default methods take care of dispatching events to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								windows and dialogs, handling drags and resizes, Apple Events, events
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								for non-FrameWork windows, etc.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								In general, all event handlers should return \code{1} if the event is fully
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								handled and \code{0} otherwise (because the front window was not a FrameWork
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								window, for instance). This is needed so that update events and such
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								can be passed on to other windows like the Sioux console window.
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Calling \function{MacOS.HandleEvent()} is not allowed within
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\var{our_dispatch} or its callees, since this may result in an
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								infinite loop if the code is called through the Python inner-loop
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								event handler.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Application]{asyncevents}{onoff}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Call this method with a nonzero parameter to enable
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								asynchronous event handling. This will tell the inner interpreter loop
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								to call the application event handler \var{async_dispatch} whenever events
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								are available. This will cause FrameWork window updates and the user
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								interface to remain working during long computations, but will slow the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								interpreter down and may cause surprising results in non-reentrant code
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								(such as FrameWork itself). By default \var{async_dispatch} will immedeately
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								call \var{our_dispatch} but you may override this to handle only certain
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								events asynchronously. Events you do not handle will be passed to Sioux
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								and such.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The old on/off value is returned.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Application]{_quit}{}
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Terminate the running \method{mainloop()} call at the next convenient
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								moment.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Application]{do_char}{c, event}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The user typed character \var{c}. The complete details of the event
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								can be found in the \var{event} structure. This method can also be
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								provided in a \code{Window} object, which overrides the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								application-wide handler if the window is frontmost.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Application]{do_dialogevent}{event}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Called early in the event loop to handle modeless dialog events. The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								default method simply dispatches the event to the relevant dialog (not
							 | 
						
					
						
							
								
									
										
										
										
											2003-08-12 00:01:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								through the \code{DialogWindow} object involved). Override if you
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								need special handling of dialog events (keyboard shortcuts, etc).
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Application]{idle}{event}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Called by the main event loop when no events are available. The
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								null-event is passed (so you can look at mouse position, etc).
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\subsection{Window Objects \label{window-objects}}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Window objects have the following methods, among others:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\setindexsubitem{(Window method)}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Window]{open}{}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Override this method to open a window. Store the MacOS window-id in
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\member{self.wid} and call the \method{do_postopen()} method to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								register the window with the parent application.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Window]{close}{}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Override this method to do any special processing on window
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								close. Call the \method{do_postclose()} method to cleanup the parent
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								state.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Window]{do_postresize}{width, height, macoswindowid}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Called after the window is resized. Override if more needs to be done
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								than calling \code{InvalRect}.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Window]{do_contentclick}{local, modifiers, event}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The user clicked in the content part of a window. The arguments are
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								the coordinates (window-relative), the key modifiers and the raw
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								event.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[Window]{do_update}{macoswindowid, event}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								An update event for the window was received. Redraw the window.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}{do_activate}{activate, event}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The window was activated (\code{\var{activate} == 1}) or deactivated
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								(\code{\var{activate} == 0}). Handle things like focus highlighting,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								etc.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\subsection{ControlsWindow Object \label{controlswindow-object}}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ControlsWindow objects have the following methods besides those of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\code{Window} objects:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ControlsWindow]{do_controlhit}{window, control,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                                  pcode, event}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Part \var{pcode} of control \var{control} was hit by the
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								user. Tracking and such has already been taken care of.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\subsection{ScrolledWindow Object \label{scrolledwindow-object}}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								ScrolledWindow objects are ControlsWindow objects with the following
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								extra methods:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ScrolledWindow]{scrollbars}{\optional{wantx\optional{,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                               wanty}}}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Create (or destroy) horizontal and vertical scrollbars. The arguments
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								specify which you want (default: both). The scrollbars always have
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								minimum \code{0} and maximum \code{32767}.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ScrolledWindow]{getscrollbarvalues}{}
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								You must supply this method. It should return a tuple \code{(\var{x},
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\var{y})} giving the current position of the scrollbars (between
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\code{0} and \code{32767}). You can return \code{None} for either to
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								indicate the whole document is visible in that direction.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ScrolledWindow]{updatescrollbars}{}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Call this method when the document has changed. It will call
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\method{getscrollbarvalues()} and update the scrollbars.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ScrolledWindow]{scrollbar_callback}{which, what, value}
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Supplied by you and called after user interaction. \var{which} will
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								be \code{'x'} or \code{'y'}, \var{what} will be \code{'-'},
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\code{'set'}, \var{value} will contain the new scrollbar position.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ScrolledWindow]{scalebarvalues}{absmin, absmax,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                                   curmin, curmax}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Auxiliary method to help you calculate values to return from
							 | 
						
					
						
							
								
									
										
										
										
											1998-04-04 06:23:02 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\method{getscrollbarvalues()}. You pass document minimum and maximum value
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								and topmost (leftmost) and bottommost (rightmost) visible values and
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								it returns the correct number or \code{None}.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ScrolledWindow]{do_activate}{onoff, event}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Takes care of dimming/highlighting scrollbars when a window becomes
							 | 
						
					
						
							
								
									
										
										
										
											2000-10-14 04:53:31 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								frontmost. If you override this method, call this one at the end of
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								your method.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ScrolledWindow]{do_postresize}{width, height, window}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Moves scrollbars to the correct position. Call this method initially
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								if you override it.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[ScrolledWindow]{do_controlhit}{window, control,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								                                                  pcode, event}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								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.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\subsection{DialogWindow Objects \label{dialogwindow-objects}}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								DialogWindow objects have the following methods besides those of
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\code{Window} objects:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[DialogWindow]{open}{resid}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Create the dialog window, from the DLOG resource with id
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\var{resid}. The dialog object is stored in \member{self.wid}.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\begin{methoddesc}[DialogWindow]{do_itemhit}{item, event}
							 | 
						
					
						
							
								
									
										
										
										
											1998-02-18 17:19:11 +00:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Item number \var{item} was hit. You are responsible for redrawing
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								toggle buttons, etc.
							 | 
						
					
						
							
								
									
										
										
										
											1999-03-02 16:37:17 +00:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								\end{methoddesc}
							 |