1 \section{\module{EasyDialogs
} ---
2 Basic Macintosh dialogs
}
4 \declaremodule{standard
}{EasyDialogs
}
6 \modulesynopsis{Basic Macintosh dialogs.
}
9 The
\module{EasyDialogs
} module contains some simple dialogs for
10 the Macintosh. All routines have an optional parameter
\var{id
} with
11 which you can override the DLOG resource used for the dialog, as long
12 as the item numbers correspond. See the source for details.
14 The
\module{EasyDialogs
} module defines the following functions:
17 \begin{funcdesc
}{Message
}{str
}
18 A modal dialog with the message text
\var{str
}, which should be at
19 most
255 characters long, is displayed. Control is returned when the
23 \begin{funcdesc
}{AskString
}{prompt
\optional{, default
}}
24 Ask the user to input a string value, in a modal dialog.
\var{prompt
}
25 is the prompt message, the optional
\var{default
} arg is the initial
26 value for the string. All strings can be at most
255 bytes
27 long.
\function{AskString()
} returns the string entered or
\code{None
}
28 in case the user cancelled.
31 \begin{funcdesc
}{AskPassword
}{prompt
\optional{, default
}}
32 Ask the user to input a string value, in a modal dialog. Like
33 \method{AskString
}, but with the text shown as bullets.
\var{prompt
}
34 is the prompt message, the optional
\var{default
} arg is the initial
35 value for the string. All strings can be at most
255 bytes
36 long.
\function{AskString()
} returns the string entered or
\code{None
}
37 in case the user cancelled.
40 \begin{funcdesc
}{AskYesNoCancel
}{question
\optional{, default
}}
41 Present a dialog with text
\var{question
} and three buttons labelled
42 ``yes'', ``no'' and ``cancel''. Return
\code{1} for yes,
\code{0} for
43 no and
\code{-
1} for cancel. The default return value chosen by
44 hitting return is
\code{0}. This can be changed with the optional
45 \var{default
} argument.
48 \begin{funcdesc
}{ProgressBar
}{\optional{title
\optional{, maxval
\optional{,label
}}}}
49 Display a modeless progress dialog with a thermometer bar.
\var{title
}
50 is the text string displayed (default ``Working...''),
\var{maxval
} is
51 the value at which progress is complete (default
52 \code{100}).
\var{label
} is the text that is displayed over the progress
53 bar itself. The returned object has two methods,
54 \code{set(
\var{value
})
}, which sets the value of the progress bar, and
55 \code{label(
\var{text
})
}, which sets the text of the label. The bar
56 remains visible until the object returned is discarded.
58 The progress bar has a ``cancel'' button.
[NOTE: how does the cancel