FontDialog

The font dialog allows users to choose a font installed on the system. It uses the native platform font selection dialog where available, or a dialog implemented in Tcl/Tk otherwise. Unlike most of the other dialogs, the fontchooser does not return an immediate result because on some platforms (Mac OSX) the standard font dialog is modeless while on others (Windows) it is modal. To accommodate this difference, all user interaction with the dialog will be communicated to the caller via commands or virtual events.

Constructors

this
this(Window parent, string title)

Construct the dialog.

this
this(string title)

Construct the dialog.

Members

Functions

hide
auto hide()

Hide the dialog.

isVisible
bool isVisible()

Check if the dialog is visible.

removeCommand
auto removeCommand()

Remove a previously set command.

setCommand
auto setCommand(CommandCallback callback)

Set the callback to execute when a new font is choosen. When the callback is executed information about the choosen font is stored as a string in the CommandArgs.Dialog struct.

show
auto show()

Show the dialog.

Inherited Members

From Dialog

_parent
Window _parent;
Undocumented in source.
_title
string _title;
Undocumented in source.
_results
string[] _results;
Undocumented in source.
getResult
string getResult()

Get the dialog result. This varies on the type of dialog used and will reflect the overall result expected of each dialog.

removeBracesFromResults
void removeBracesFromResults()

Remove any leading or trailing braces.

show
auto show()

Show the dialog.

Examples

auto dialog = new FontDialog("Select a font")
	.setCommand(delegate(CommandArgs args){
		string font = args.dialog.font;
	})
	.show();

Additional Events

Additional events that can also be bound to using the bind method.

<<TkFontchooserFontChanged>>, <<TkFontchooserVisibility>>,

Result: The result is empty as all interaction takes place via callbacks.

See Also

Meta