Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 41788db

Browse files
committed
Logical markup.
Index entries.
1 parent 9b28fe2 commit 41788db

20 files changed

Lines changed: 692 additions & 639 deletions

Doc/lib/libframework.tex

Lines changed: 33 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ \section{Standard Module \sectcode{FrameWork}}
22
\stmodindex{FrameWork}
33
\label{module-FrameWork}
44

5-
The \code{FrameWork} module contains classes that together provide a
5+
The \module{FrameWork} module contains classes that together provide a
66
framework for an interactive Macintosh application. The programmer
77
builds an application by creating subclasses that override various
88
methods of the bases classes, thereby implementing the functionality
@@ -11,18 +11,17 @@ \section{Standard Module \sectcode{FrameWork}}
1111
non-standard way it is not necessary to override the complete event
1212
handling.
1313

14-
The \code{FrameWork} is still very much work-in-progress, and the
14+
The \module{FrameWork} is still very much work-in-progress, and the
1515
documentation describes only the most important functionality, and not
1616
in the most logical manner at that. Examine the source or the examples
1717
for more details.
1818

19-
The \code{FrameWork} module defines the following functions:
19+
The \module{FrameWork} module defines the following functions:
2020

21-
\setindexsubitem{(in module FrameWork)}
2221

2322
\begin{funcdesc}{Application}{}
2423
An object representing the complete application. See below for a
25-
description of the methods. The default \code{__init__} routine
24+
description of the methods. The default \method{__init__()} routine
2625
creates an empty window dictionary and a menu bar with an apple menu.
2726
\end{funcdesc}
2827

@@ -88,23 +87,25 @@ \section{Standard Module \sectcode{FrameWork}}
8887
Set the mouse cursor to an arrow.
8988
\end{funcdesc}
9089

91-
\subsection{Application objects}
90+
\subsection{Application Objects}
91+
\label{application-objects}
92+
9293
Application objects have the following methods, among others:
9394

9495
\setindexsubitem{(Application method)}
9596

9697
\begin{funcdesc}{makeusermenus}{}
9798
Override this method if you need menus in your application. Append the
98-
menus to \code{self.menubar}.
99+
menus to the attribute \member{menubar}.
99100
\end{funcdesc}
100101

101102
\begin{funcdesc}{getabouttext}{}
102103
Override this method to return a text string describing your
103-
application. Alternatively, override the \code{do_about} method for
104-
more elaborate about messages.
104+
application. Alternatively, override the \method{do_about()} method
105+
for more elaborate ``about'' messages.
105106
\end{funcdesc}
106107

107-
\begin{funcdesc}{mainloop}{\optional{mask, wait}}
108+
\begin{funcdesc}{mainloop}{\optional{mask\optional{, wait}}}
108109
This routine is the main event loop, call it to set your application
109110
rolling. \var{Mask} is the mask of events you want to handle,
110111
\var{wait} is the number of ticks you want to leave to other
@@ -117,13 +118,14 @@ \subsection{Application objects}
117118
windows and dialogs, handling drags and resizes, Apple Events, events
118119
for non-FrameWork windows, etc.
119120

120-
In general, all event handlers should return 1 if the event is fully
121-
handled and 0 otherwise (because the front window was not a FrameWork
121+
In general, all event handlers should return \code{1} if the event is fully
122+
handled and \code{0} otherwise (because the front window was not a FrameWork
122123
window, for instance). This is needed so that update events and such
123124
can be passed on to other windows like the Sioux console window.
124-
Calling \code{MacOS.HandleEvent} is not allowed within \var{our_dispatch}
125-
or its callees, since this may result in an infinite loop if the
126-
code is called through the Python inner-loop event handler.
125+
Calling \function{MacOS.HandleEvent()} is not allowed within
126+
\var{our_dispatch} or its callees, since this may result in an
127+
infinite loop if the code is called through the Python inner-loop
128+
event handler.
127129
\end{funcdesc}
128130

129131
\begin{funcdesc}{asyncevents}{onoff}
@@ -142,7 +144,8 @@ \subsection{Application objects}
142144
\end{funcdesc}
143145

144146
\begin{funcdesc}{_quit}{}
145-
Terminate the event \code{mainloop} at the next convenient moment.
147+
Terminate the running \method{mainloop()} call at the next convenient
148+
moment.
146149
\end{funcdesc}
147150

148151
\begin{funcdesc}{do_char}{c, event}
@@ -165,6 +168,7 @@ \subsection{Application objects}
165168
\end{funcdesc}
166169

167170
\subsection{Window Objects}
171+
\label{window-objects}
168172

169173
Window objects have the following methods, among others:
170174

@@ -202,6 +206,7 @@ \subsection{Window Objects}
202206
\end{funcdesc}
203207

204208
\subsection{ControlsWindow Object}
209+
\label{controlswindow-object}
205210

206211
ControlsWindow objects have the following methods besides those of
207212
\code{Window} objects:
@@ -214,40 +219,41 @@ \subsection{ControlsWindow Object}
214219
\end{funcdesc}
215220

216221
\subsection{ScrolledWindow Object}
222+
\label{scrolledwindow-object}
217223

218224
ScrolledWindow objects are ControlsWindow objects with the following
219225
extra methods:
220226

221227
\setindexsubitem{(ScrolledWindow method)}
222228

223-
\begin{funcdesc}{scrollbars}{\optional{wantx, wanty}}
229+
\begin{funcdesc}{scrollbars}{\optional{wantx\optional{, wanty}}}
224230
Create (or destroy) horizontal and vertical scrollbars. The arguments
225231
specify which you want (default: both). The scrollbars always have
226232
minimum \code{0} and maximum \code{32767}.
227233
\end{funcdesc}
228234

229235
\begin{funcdesc}{getscrollbarvalues}{}
230-
You must supply this method. It should return a tuple \code{x, y}
231-
giving the current position of the scrollbars (between \code{0} and
232-
\code{32767}). You can return \code{None} for either to indicate the
233-
whole document is visible in that direction.
236+
You must supply this method. It should return a tuple \code{(\var{x},
237+
\var{y})} giving the current position of the scrollbars (between
238+
\code{0} and \code{32767}). You can return \code{None} for either to
239+
indicate the whole document is visible in that direction.
234240
\end{funcdesc}
235241

236242
\begin{funcdesc}{updatescrollbars}{}
237243
Call this method when the document has changed. It will call
238-
\code{getscrollbarvalues} and update the scrollbars.
244+
\method{getscrollbarvalues()} and update the scrollbars.
239245
\end{funcdesc}
240246

241247
\begin{funcdesc}{scrollbar_callback}{which, what, value}
242-
Supplied by you and called after user interaction. \code{Which} will
243-
be \code{'x'} or \code{'y'}, \code{what} will be \code{'-'},
248+
Supplied by you and called after user interaction. \var{which} will
249+
be \code{'x'} or \code{'y'}, \var{what} will be \code{'-'},
244250
\code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For
245-
\code{'set'}, \code{value} will contain the new scrollbar position.
251+
\code{'set'}, \var{value} will contain the new scrollbar position.
246252
\end{funcdesc}
247253

248254
\begin{funcdesc}{scalebarvalues}{absmin, absmax, curmin, curmax}
249255
Auxiliary method to help you calculate values to return from
250-
\code{getscrollbarvalues}. You pass document minimum and maximum value
256+
\method{getscrollbarvalues()}. You pass document minimum and maximum value
251257
and topmost (leftmost) and bottommost (rightmost) visible values and
252258
it returns the correct number or \code{None}.
253259
\end{funcdesc}
@@ -270,6 +276,7 @@ \subsection{ScrolledWindow Object}
270276
\end{funcdesc}
271277

272278
\subsection{DialogWindow Objects}
279+
\label{dialogwindow-objects}
273280

274281
DialogWindow objects have the following methods besides those of
275282
\code{Window} objects:

Doc/lib/libminiae.tex

Lines changed: 33 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,63 @@
1-
\section{Standard Module \sectcode{MiniAEFrame}}
1+
\section{Standard Module \module{MiniAEFrame}}
22
\stmodindex{MiniAEFrame}
33
\label{module-MiniAEFrame}
44

5-
The module \var{MiniAEFrame} provides a framework for an application
6-
that can function as an OSA server, i.e. receive and process
7-
AppleEvents. It can be used in conjunction with \var{FrameWork} or
8-
standalone.
5+
The module \module{MiniAEFrame} provides a framework for an application
6+
that can function as an Open Scripting Architecture
7+
\index{Open Scripting Architecture}
8+
(OSA) server, i.e. receive and process
9+
AppleEvents\index{AppleEvents}. It can be used in conjunction with
10+
\module{FrameWork}\refstmodindex{FrameWork} or standalone.
911

1012
This module is temporary, it will eventually be replaced by a module
1113
that handles argument names better and possibly automates making your
1214
application scriptable.
1315

14-
The \var{MiniAEFrame} module defines the following classes:
16+
The \module{MiniAEFrame} module defines the following classes:
1517

16-
\setindexsubitem{(in module MiniAEFrame)}
1718

18-
\begin{funcdesc}{AEServer}{}
19+
\begin{classdesc}{AEServer}{}
1920
A class that handles AppleEvent dispatch. Your application should
2021
subclass this class together with either
21-
\code{MiniAEFrame.MiniApplication} or
22-
\code{FrameWork.Application}. Your \code{__init__} method should call
23-
the \code{__init__} method for both classes.
24-
\end{funcdesc}
22+
\class{MiniApplication} or
23+
\class{FrameWork.Application}. Your \method{__init__()} method should
24+
call the \method{__init__()} method for both classes.
25+
\end{classdesc}
2526

26-
\begin{funcdesc}{MiniApplication}{}
27+
\begin{classdesc}{MiniApplication}{}
2728
A class that is more or less compatible with
28-
\code{FrameWork.Application} but with less functionality. Its
29-
eventloop supports the apple menu, command-dot and AppleEvents, other
29+
\class{FrameWork.Application} but with less functionality. Its
30+
event loop supports the apple menu, command-dot and AppleEvents; other
3031
events are passed on to the Python interpreter and/or Sioux.
31-
Useful if your application wants to use \code{AEServer} but does not
32+
Useful if your application wants to use \class{AEServer} but does not
3233
provide its own windows, etc.
33-
\end{funcdesc}
34+
\end{classdesc}
3435

35-
\subsection{AEServer Objects}
3636

37-
\setindexsubitem{(AEServer method)}
37+
\subsection{AEServer Objects}
38+
\label{aeserver-objects}
3839

39-
\begin{funcdesc}{installaehandler}{classe, type, callback}
40-
Installs an AppleEvent handler. \code{Classe} and \code{type} are the
41-
four-char OSA Class and Type designators, \code{'****'} wildcards are
42-
allowed. When a matching AppleEvent is received the parameters are
40+
\begin{methoddesc}[AEServer]{installaehandler}{classe, type, callback}
41+
Installs an AppleEvent handler. \var{classe} and \var{type} are the
42+
four-character OSA Class and Type designators, \code{'****'} wildcards
43+
are allowed. When a matching AppleEvent is received the parameters are
4344
decoded and your callback is invoked.
44-
\end{funcdesc}
45+
\end{methoddesc}
4546

46-
\begin{funcdesc}{callback}{_object, **kwargs}
47+
\begin{methoddesc}[AEServer]{callback}{_object, **kwargs}
4748
Your callback is called with the OSA Direct Object as first positional
4849
parameter. The other parameters are passed as keyword arguments, with
49-
the 4-char designator as name. Three extra keyword parameters are
50+
the 4-character designator as name. Three extra keyword parameters are
5051
passed: \code{_class} and \code{_type} are the Class and Type
5152
designators and \code{_attributes} is a dictionary with the AppleEvent
5253
attributes.
5354

5455
The return value of your method is packed with
55-
\code{aetools.packevent} and sent as reply.
56-
\end{funcdesc}
56+
\function{aetools.packevent()} and sent as reply.
57+
\end{methoddesc}
5758

5859
Note that there are some serious problems with the current
59-
design. AppleEvents which have non-identifier 4-char designators for
60-
arguments are not implementable, and it is not possible to return an
61-
error to the originator. This will be addressed in a future release.
60+
design. AppleEvents which have non-identifier 4-character designators
61+
for arguments are not implementable, and it is not possible to return
62+
an error to the originator. This will be addressed in a future
63+
release.

0 commit comments

Comments
 (0)