annotate Doc/mac/libmacui.tex @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents 4cef23e1dcca
children 3468ea8645ca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
1 \section{Standard module \sectcode{EasyDialogs}}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
2 \stmodindex{EasyDialogs}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
3
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
4 The \code{EasyDialogs} module contains some simple dialogs for
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
5 the Macintosh, modelled after the \code{stdwin} dialogs with similar
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
6 names.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
7
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
8 The \code{EasyDialogs} module defines the following functions:
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
9
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
10 \renewcommand{\indexsubitem}{(in module EasyDialogs)}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
11
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
12 \begin{funcdesc}{Message}{str}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
13 A modal dialog with the message text \var{str}, which should be at
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
14 most 255 characters long, is displayed. Control is returned when the
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
15 user clicks ``OK''.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
16 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
17
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
18 \begin{funcdesc}{AskString}{prompt\optional{\, default}}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
19 Ask the user to input a string value, in a modal dialog. \var{Prompt}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
20 is the promt message, the optional \var{default} arg is the initial
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
21 value for the string. All strings can be at most 255 bytes
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
22 long. \var{AskString} returns the string entered or \code{None} in
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
23 case the user cancelled.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
24 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
25
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
26 \begin{funcdesc}{AskYesNoCancel}{question\optional{\, default}}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
27 Present a dialog with text \var{question} and three buttons labelled
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
28 ``yes'', ``no'' and ``cancel''. Return \code{1} for yes, \code{0} for
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
29 no and \code{-1} for cancel. The default return value chosen by
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
30 hitting return is \code{0}. This can be changed with the optional
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
31 \var{default} argument.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
32 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
33
3258
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
34 \begin{funcdesc}{ProgressBar}{\optional{label\, maxval}}
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
35 Display a modeless progress dialog with a thermometer bar. \var{Label}
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
36 is the textstring displayed (default ``Working...''), \var{maxval} is
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
37 the value at which progress is complete (default 100). The returned
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
38 object has one method, \code{set(value)}, which sets the value of the
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
39 progress bar. The bar remains visible until the object returned is
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
40 discarded.
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
41
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
42 The progress bar has a ``cancel'' button, but it is currently
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
43 non-functional.
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
44 \end{funcdesc}
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
45
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
46 Note that \code{EasyDialogs} does not currently use the notification
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
47 manager. This means that displaying dialogs while the program is in
3258
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
48 the background will lead to unexpected results and possibly
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
49 crashes. Also, all dialogs are modeless and hence expect to be at the
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
50 top of the stacking order. This is true when the dialogs are created,
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
51 but windows that pop-up later (like a console window) may also result
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
52 in crashes.
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
53
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
54
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
55 \section{Standard module \sectcode{FrameWork}}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
56 \stmodindex{FrameWork}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
57
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
58 The \code{FrameWork} module contains classes that together provide a
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
59 framework for an interactive Macintosh application. The programmer
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
60 builds an application by creating subclasses that override various
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
61 methods of the bases classes, thereby implementing the functionality
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
62 wanted. Overriding functionality can often be done on various
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
63 different levels, i.e. to handle clicks in a single dialog window in a
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
64 non-standard way it is not necessary to override the complete event
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
65 handling.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
66
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
67 The \code{FrameWork} is still very much work-in-progress, and the
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
68 documentation describes only the most important functionality, and not
3758
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
69 in the most logical manner at that. Examine the source or the examples
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
70 for more details.
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
71
3758
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
72 The \code{FrameWork} module defines the following functions:
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
73
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
74 \renewcommand{\indexsubitem}{(in module FrameWork)}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
75
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
76 \begin{funcdesc}{Application}{}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
77 An object representing the complete application. See below for a
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
78 description of the methods. The default \code{__init__} routine
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
79 creates an empty window dictionary and a menu bar with an apple menu.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
80 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
81
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
82 \begin{funcdesc}{MenuBar}{}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
83 An object representing the menubar. This object is usually not created
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
84 by the user.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
85 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
86
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
87 \begin{funcdesc}{Menu}{bar\, title\optional{\, after}}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
88 An object representing a menu. Upon creation you pass the
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
89 \code{MenuBar} the menu appears in, the \var{title} string and a
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
90 position (1-based) \var{after} where the menu should appear (default:
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
91 at the end).
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
92 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
93
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
94 \begin{funcdesc}{MenuItem}{menu\, title\optional{\, shortcut\, callback}}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
95 Create a menu item object. The arguments are the menu to crate the
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
96 item it, the item title string and optionally the keyboard shortcut
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
97 and a callback routine. The callback is called with the arguments
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
98 menu-id, item number within menu (1-based), current front window and
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
99 the event record.
4410
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
100
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
101 In stead of a callable object the callback can also be a string. In
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
102 this case menu selection causes the lookup of a method in the topmost
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
103 window and the application. The method name is the callback string
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
104 with \code{'domenu_'} prepended.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
105
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
106 Calling the \code{MenuBar} \code{fixmenudimstate} method sets the
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
107 correct dimming for all menu items based on the current front window.
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
108 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
109
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
110 \begin{funcdesc}{Separator}{menu}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
111 Add a separator to the end of a menu.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
112 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
113
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
114 \begin{funcdesc}{SubMenu}{menu\, label}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
115 Create a submenu named \var{label} under menu \var{menu}. The menu
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
116 object is returned.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
117 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
118
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
119 \begin{funcdesc}{Window}{parent}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
120 Creates a (modeless) window. \var{Parent} is the application object to
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
121 which the window belongs. The window is not displayed until later.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
122 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
123
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
124 \begin{funcdesc}{DialogWindow}{parent}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
125 Creates a modeless dialog window.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
126 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
127
3758
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
128 \begin{funcdesc}{windowbounds}{width\, height}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
129 Return a \code{(left, top, right, bottom)} tuple suitable for creation
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
130 of a window of given width and height. The window will be staggered
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
131 with respect to previous windows, and an attempt is made to keep the
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
132 whole window on-screen. The window will however always be exact the
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
133 size given, so parts may be offscreen.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
134 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
135
4410
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
136 \begin{funcdesc}{setwatchcursor}{}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
137 Set the mouse cursor to a watch.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
138 \end{funcdesc}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
139
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
140 \begin{funcdesc}{setarrowcursor}{}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
141 Set the mouse cursor to an arrow.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
142 \end{funcdesc}
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
143
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
144 \subsection{Application objects}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
145 Application objects have the following methods, among others:
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
146
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
147 \renewcommand{\indexsubitem}{(Application method)}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
148
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
149 \begin{funcdesc}{makeusermenus}{}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
150 Override this method if you need menus in your application. Append the
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
151 menus to \code{self.menubar}.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
152 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
153
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
154 \begin{funcdesc}{getabouttext}{}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
155 Override this method to return a text string describing your
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
156 application. Alternatively, override the \code{do_about} method for
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
157 more elaborate about messages.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
158 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
159
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
160 \begin{funcdesc}{mainloop}{\optional{mask\, wait}}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
161 This routine is the main event loop, call it to set your application
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
162 rolling. \var{Mask} is the mask of events you want to handle,
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
163 \var{wait} is the number of ticks you want to leave to other
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
164 concurrent application (default 0, which is probably not a good
4410
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
165 idea). While raising \code{self} to exit the mainloop is still
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
166 supported it is not recommended, call \code{self._quit} instead.
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
167
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
168 The event loop is split into many small parts, each of which can be
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
169 overridden. The default methods take care of dispatching events to
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
170 windows and dialogs, handling drags and resizes, Apple Events, events
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
171 for non-FrameWork windows, etc.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
172 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
173
4410
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
174 \begin{funcdesc}{_quit}{}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
175 Terminate the event \code{mainloop} at the next convenient moment.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
176 \end{funcdesc}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
177
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
178 \begin{funcdesc}{do_char}{c\, event}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
179 The user typed character \var{c}. The complete details of the event
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
180 can be found in the \var{event} structure. This method can also be
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
181 provided in a \code{Window} object, which overrides the
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
182 application-wide handler if the window is frontmost.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
183 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
184
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
185 \begin{funcdesc}{do_dialogevent}{event}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
186 Called early in the event loop to handle modeless dialog events. The
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
187 default method simply dispatches the event to the relevant dialog (not
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
188 through the the \code{DialogWindow} object involved). Override if you
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
189 need special handling of dialog events (keyboard shortcuts, etc).
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
190 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
191
3758
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
192 \begin{funcdesc}{idle}{event}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
193 Called by the main event loop when no events are available. The
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
194 null-event is passed (so you can look at mouse position, etc).
3258
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
195 \end{funcdesc}
6e48fab6990f Documented ProgressBar and idle()
Jack Jansen <jack.jansen@cwi.nl>
parents: 3194
diff changeset
196
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
197 \subsection{Window Objects}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
198
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
199 Window objects have the following methods, among others:
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
200
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
201 \renewcommand{\indexsubitem}{(Window method)}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
202
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
203 \begin{funcdesc}{open}{}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
204 Override this method to open a window. Store the MacOS window-id in
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
205 \code{self.wid} and call \code{self.do_postopen} to register the
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
206 window with the parent application.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
207 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
208
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
209 \begin{funcdesc}{close}{}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
210 Override this method to do any special processing on window
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
211 close. Call \code{self.do_postclose} to cleanup the parent state.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
212 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
213
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
214 \begin{funcdesc}{do_postresize}{width\, height\, macoswindowid}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
215 Called after the window is resized. Override if more needs to be done
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
216 than calling \code{InvalRect}.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
217 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
218
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
219 \begin{funcdesc}{do_contentclick}{local\, modifiers\, event}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
220 The user clicked in the content part of a window. The arguments are
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
221 the coordinates (window-relative), the key modifiers and the raw
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
222 event.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
223 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
224
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
225 \begin{funcdesc}{do_update}{macoswindowid\, event}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
226 An update event for the window was received. Redraw the window.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
227 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
228
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
229 \begin{funcdesc}{do_activate}{activate\, event}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
230 The window was activated (\code{activate==1}) or deactivated
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
231 (\code{activate==0}). Handle things like focus highlighting, etc.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
232 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
233
3758
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
234 \subsection{ControlsWindow Object}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
235
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
236 ControlsWindow objects have the following methods besides those of
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
237 \code{Window} objects:
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
238
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
239 \renewcommand{\indexsubitem}{(ControlsWindow method)}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
240
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
241 \begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
242 Part \code{pcode} of control \code{control} was hit by the
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
243 user. Tracking and such has already been taken care of.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
244 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
245
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
246 \subsection{ScrolledWindow Object}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
247
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
248 ScrolledWindow objects are ControlsWindow objects with the following
4410
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
249 extra methods:
3758
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
250
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
251 \renewcommand{\indexsubitem}{(ScrolledWindow method)}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
252
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
253 \begin{funcdesc}{scrollbars}{\optional{wantx\, wanty}}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
254 Create (or destroy) horizontal and vertical scrollbars. The arguments
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
255 specify which you want (default: both). The scrollbars always have
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
256 minimum \code{0} and maximum \code{32767}.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
257 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
258
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
259 \begin{funcdesc}{getscrollbarvalues}{}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
260 You must supply this method. It should return a tuple \code{x, y}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
261 giving the current position of the scrollbars (between \code{0} and
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
262 \code{32767}). You can return \code{None} for either to indicate the
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
263 whole document is visible in that direction.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
264 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
265
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
266 \begin{funcdesc}{updatescrollbars}{}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
267 Call this method when the document has changed. It will call
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
268 \code{getscrollbarvalues} and update the scrollbars.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
269 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
270
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
271 \begin{funcdesc}{scrollbar_callback}{which\, what\, value}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
272 Supplied by you and called after user interaction. \code{Which} will
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
273 be \code{'x'} or \code{'y'}, \code{what} will be \code{'-'},
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
274 \code{'--'}, \code{'set'}, \code{'++'} or \code{'+'}. For
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
275 \code{'set'}, \code{value} will contain the new scrollbar position.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
276 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
277
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
278 \begin{funcdesc}{scalebarvalues}{absmin\, absmax\, curmin\, curmax}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
279 Auxiliary method to help you calculate values to return from
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
280 \code{getscrollbarvalues}. You pass document minimum and maximum value
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
281 and topmost (leftmost) and bottommost (rightmost) visible values and
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
282 it returns the correct number or \code{None}.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
283 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
284
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
285 \begin{funcdesc}{do_activate}{onoff\, event}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
286 Takes care of dimming/highlighting scrollbars when a window becomes
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
287 frontmost vv. If you override this method call this one at the end of
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
288 your method.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
289 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
290
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
291 \begin{funcdesc}{do_postresize}{width\, height\, window}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
292 Moves scrollbars to the correct position. Call this method initially
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
293 if you override it.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
294 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
295
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
296 \begin{funcdesc}{do_controlhit}{window\, control\, pcode\, event}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
297 Handles scrollbar interaction. If you override it call this method
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
298 first, a nonzero return value indicates the hit was in the scrollbars
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
299 and has been handled.
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
300 \end{funcdesc}
b916d614e363 changes by Jack to Mac docs
Guido van Rossum <guido@python.org>
parents: 3258
diff changeset
301
3194
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
302 \subsection{DialogWindow Objects}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
303
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
304 DialogWindow objects have the following methods besides those of
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
305 \code{Window} objects:
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
306
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
307 \renewcommand{\indexsubitem}{(DialogWindow method)}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
308
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
309 \begin{funcdesc}{open}{resid}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
310 Create the dialog window, from the DLOG resource with id
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
311 \var{resid}. The dialog object is stored in \code{self.wid}.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
312 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
313
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
314 \begin{funcdesc}{do_itemhit}{item\, event}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
315 Item number \var{item} was hit. You are responsible for redrawing
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
316 toggle buttons, etc.
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
317 \end{funcdesc}
05aeb91e3b90 Documented MACFS, macostools, EasyDialogs and FrameWork modules.
Jack Jansen <jack.jansen@cwi.nl>
parents:
diff changeset
318
4410
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
319 \section{Standard module \sectcode{MiniAEFrame}}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
320 \stmodindex{MiniAEFrame}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
321
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
322 The module \var{MiniAEFrame} provides a framework for an application
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
323 that can function as an OSA server, i.e. receive and process
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
324 AppleEvents. It can be used in conjunction with \var{FrameWork} or
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
325 standalone.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
326
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
327 This module is temporary, it will eventually be replaced by a module
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
328 that handles argument names better and possibly automates making your
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
329 application scriptable.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
330
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
331 The \var{MiniAEFrame} module defines the following classes:
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
332
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
333 \renewcommand{\indexsubitem}{(in module MiniAEFrame)}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
334
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
335 \begin{funcdesc}{AEServer}{}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
336 A class that handles AppleEvent dispatch. Your application should
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
337 subclass this class together with either
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
338 \code{MiniAEFrame.MiniApplication} or
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
339 \code{FrameWork.Application}. Your \code{__init__} method should call
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
340 the \code{__init__} method for both classes.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
341 \end{funcdesc}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
342
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
343 \begin{funcdesc}{MiniApplication}{}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
344 A class that is more or less compatible with
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
345 \code{FrameWork.Application} but with less functionality. Its
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
346 eventloop supports the apple menu, command-dot and AppleEvents, other
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
347 events are passed on to the Python interpreter and/or Sioux.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
348 Useful if your application wants to use \code{AEServer} but does not
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
349 provide its own windows, etc.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
350 \end{funcdesc}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
351
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
352 \subsection{AEServer Objects}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
353
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
354 \renewcommand{\indexsubitem}{(AEServer method)}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
355
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
356 \begin{funcdesc}{installaehandler}{classe\, type\, callback}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
357 Installs an AppleEvent handler. \code{Classe} and \code{type} are the
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
358 four-char OSA Class and Type designators, \code{'****'} wildcards are
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
359 allowed. When a matching AppleEvent is received the parameters are
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
360 decoded and your callback is invoked.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
361 \end{funcdesc}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
362
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
363 \begin{funcdesc}{callback}{_object\, **kwargs}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
364 Your callback is called with the OSA Direct Object as first positional
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
365 parameter. The other parameters are passed as keyword arguments, with
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
366 the 4-char designator as name. Three extra keyword parameters are
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
367 passed: \code{_class} and \code{_type} are the Class and Type
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
368 designators and \code{_attributes} is a dictionary with the AppleEvent
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
369 attributes.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
370
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
371 The return value of your method is packed with
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
372 \code{aetools.packevent} and sent as reply.
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
373 \end{funcdesc}
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
374
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
375 Note that there are some serious problems with the current
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
376 design. AppleEvents which have non-identifier 4-char designators for
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
377 arguments are not implementable, and it is not possible to return an
4cef23e1dcca Patches for Mac module docs by Jack
Guido van Rossum <guido@python.org>
parents: 3758
diff changeset
378 error to the originator. This will be addressed in a future release.