#
Prev |  | Next

# fontSelection

## Name

fontSelection -- A standard dialog to choose a font.

## Synopsis

fontSelection [`-option` `value`...]

## Screenshot

## Options

-title

  type: string (default: "")

  Title of the fontSelection.

-modal

  type: boolean (default: 0)

  Whether the window is modal, i.e. it grabs all GTK+ events. If the dialog is created modal, the command returns the chosen color as list of rgba values or the empty string instead of the usual widget ID.

-font

  type: FONT

  Default font for the dialog.

-previewText

  type: string (default: "abcdefghijk ABCDEFGHIJK")

  Text which is used in the preview.

-onClicked

  type: string (default: "")

  Command to be executed in the global scope if the Ok or Cancel button is chosen. Before evaluation the following percent strings are substituted: TABLE %% | % %x | button chosen: OK or CANCEL %f | font chosen /TABLE

-visible

  type: boolean (default: 1)

  Whether or not the item is visible.

-name

  type: string

  Name of the widget, can be used to set options in an rc file.

-onDestroy

  type: string (default: "")

  Tcl command which is executed if the widget is destroyed. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name. TABLE

## Description

A fontSelection is used to let the user choose a font in a standardized way. If the dialog is created modal, the commands returns the font or the empty string if Cancel is chosen. Otherwise it returns a widget ID in the usual way. The font and buttons chosen can be retrieved via the onClicked command.

## Commands

`id` delete

  Deletes the widget and the associated tcl command.

`id` configure [`-option` `value`...]

  Configures the widget. Option may have any of the values accepted on creation of the widget.

## Example

    set font [gnocl::fontSelection -title "Please choose a font" -modal 1 -font "Serif Bold 14"]

results in

## See also

fileSelection, colorSelection, `GtkFontSelectionDialog`

Prev | Home | Next
fontButton | Up | tree