GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||
GeezerVison is showing docs.python.org — 37.5. EasyDialogs — Basic Macintosh dialogs — Python 2.7.18 documentation
This document is for an old version of Python that is no longer supported.
You should upgrade and read the
Python documentation for the current stable release.
37.5.
|
optstr format |
Command-line format |
|---|---|
|
|
|
|
|
|
|
|
commandlist is a list of items of the form cmdstr or (cmdstr, descr),
where descr is as above. The cmdstrs will appear in a popup menu. When
chosen, the text of cmdstr will be appended to the command line as is, except
that a trailing ':' or '=' (if present) will be trimmed off.
New in version 2.0.
EasyDialogs.AskFileForOpen([message] [, typeList] [, defaultLocation] [, defaultOptionFlags] [, location] [, clientName] [, windowTitle] [, actionButtonLabel] [, cancelButtonLabel] [, preferenceKey] [, popupExtension] [, eventProc] [, previewProc] [, filterProc] [, wanted] )¶Post a dialog asking the user for a file to open, and return the file selected
or None if the user cancelled. message is a text message to display,
typeList is a list of 4-char filetypes allowable, defaultLocation is the
pathname, FSSpec or FSRef of the folder to show initially,
location is the (x, y) position on the screen where the dialog is shown,
actionButtonLabel is a string to show instead of “Open” in the OK button,
cancelButtonLabel is a string to show instead of “Cancel” in the cancel
button, wanted is the type of value wanted as a return: str,
unicode, FSSpec, FSRef and subtypes thereof are
acceptable.
For a description of the other arguments please see the Apple Navigation
Services documentation and the EasyDialogs source code.
EasyDialogs.AskFileForSave([message] [, savedFileName] [, defaultLocation] [, defaultOptionFlags] [, location] [, clientName] [, windowTitle] [, actionButtonLabel] [, cancelButtonLabel] [, preferenceKey] [, popupExtension] [, fileType] [, fileCreator] [, eventProc] [, wanted] )¶Post a dialog asking the user for a file to save to, and return the file
selected or None if the user cancelled. savedFileName is the default
for the file name to save to (the return value). See AskFileForOpen() for
a description of the other arguments.
EasyDialogs.AskFolder([message] [, defaultLocation] [, defaultOptionFlags] [, location] [, clientName] [, windowTitle] [, actionButtonLabel] [, cancelButtonLabel] [, preferenceKey] [, popupExtension] [, eventProc] [, filterProc] [, wanted] )¶Post a dialog asking the user to select a folder, and return the folder selected
or None if the user cancelled. See AskFileForOpen() for a
description of the arguments.
See also
Programmer’s reference documentation for the Navigation Services, a part of the Carbon framework.
ProgressBar objects provide support for modeless progress-bar dialogs.
Both determinate (thermometer style) and indeterminate (barber-pole style)
progress bars are supported. The bar will be determinate if its maximum value
is greater than zero; otherwise it will be indeterminate.
Changed in version 2.2: Support for indeterminate-style progress bars was added.
The dialog is displayed immediately after creation. If the dialog’s “Cancel”
button is pressed, or if Cmd-. or ESC is typed, the dialog window
is hidden and KeyboardInterrupt is raised (but note that this response
does not occur until the progress bar is next updated, typically via a call to
inc() or set()). Otherwise, the bar remains visible until the
ProgressBar object is discarded.
ProgressBar objects possess the following attributes and methods:
ProgressBar.curval¶The current value (of type integer or long integer) of the progress bar. The
normal access methods coerce curval between 0 and maxval.
This attribute should not be altered directly.
ProgressBar.maxval¶The maximum value (of type integer or long integer) of the progress bar; the
progress bar (thermometer style) is full when curval equals
maxval. If maxval is 0, the bar will be indeterminate
(barber-pole). This attribute should not be altered directly.
ProgressBar.title([newstr])¶Sets the text in the title bar of the progress dialog to newstr.
ProgressBar.label([newstr])¶Sets the text in the progress box of the progress dialog to newstr.
ProgressBar.set(value[, max])¶Sets the progress bar’s curval to value, and also maxval to
max if the latter is provided. value is first coerced between 0 and
maxval. The thermometer bar is updated to reflect the changes,
including a change from indeterminate to determinate or vice versa.
ProgressBar.inc([n])¶Increments the progress bar’s curval by n, or by 1 if n is not
provided. (Note that n may be negative, in which case the effect is a
decrement.) The progress bar is updated to reflect the change. If the bar is
indeterminate, this causes one “spin” of the barber pole. The resulting
curval is coerced between 0 and maxval if incrementing causes it
to fall outside this range.