robofab.interface.all.dialogs
Sometimes you need simple dialogs to get scripts to talk to the user. As RoboFab can run in many different environments, this dialog module tries to offer consistent functionality in all worlds. Most of the dialogs work in FontLab Mac/Win and Python IDE Mac. Some dialogs also work in windows. This module offers the right kind of dialog for the environment you call them in. A bit like robofab.world helps you out by finding the right objects. Availability: FontLab means that the dialogs are available in FontLab on either platform. Mac means that the dialogs are available in plain Python for OS9 as well as OSX. Windows means the dialogs are available in plain Python in Windows.
Overview
Message(message, title='RoboFab')
A simple message dialog with just one OK button. It does not return any values.
- Available on FontLab, Macintosh

AskString(prompt, value='', title='RoboFab')
Asks for a string and return it. Returns None if the user cancelled.
- Available on FontLab, Macintosh

AskYesNoCancel(prompt, title='RoboFab', default=0)
Returns 1 for 'Yes', 0 for 'No' and -1 for 'Cancel'. "default" argument only available on Macintosh)
- Available on FontLab, Macintosh

GetFile(message=None)
A standard select file dialog. Returns path if one is selected. Otherwise it returns None.
- Available on FontLab, Macintosh, PC
GetFolder(message=None)
A standard select folder dialog. Returns path if one is selected. Otherwise it returns None.
- Available on FontLab, Macintosh, PC
PutFile(message=None, defaultName=None)
Save file dialog. Returns path if one is entered. Otherwise it returns None.
- Available on FontLab, Macintosh, PC
SelectFont(message="Select a font:", title='RoboFab')
Returns font instance if there is one, otherwise it returns None.
- Available on FontLab

SelectGlyph(font, message="Select a glyph:", title='RoboFab')
Returns glyph instance from font if a glyph is selected. Otherwise it returns None.
- Available on FontLab

FindGlyph(aFont, message="Search for a glyph:", title='RoboFab')
The FindGlyph dialog offers a list of the glyphs present in a font. A name or partial name can be types to navigate to the wanted glyph quickly.
- Available on FontLab

GetFolder(message=None)
Select folder dialog. Returns the selected path if one is picked. Otherwise it returns None.
- Available on FontLab, Macintosh, PC