A button to launch a font selection dialog
The <gtk-font-button>
is a button which displays the currently selected
font an allows to open a font selection dialog to change the font. It is
suitable widget for selecting a font in a preference dialog.
Derives from
<gtk-button>
.This class defines the following slots:
title
- The title of the font selection dialog
font-name
- The name of the selected font
use-font
- Whether the label is drawn in the selected font
use-size
- Whether the label is drawn with the selected font size
show-style
- Whether the selected font style is shown in the label
show-size
- Whether selected font size is shown in the label
The ::font-set signal is emitted when the user selects a font. When handling this signal, use
gtk-font-button-get-font-name
to find out which font was just selected.Note that this signal is only emitted when the user changes the font. If you need to react to programmatic font changes as well, use the notify::font-name signal.
Since 2.4
<gtk-widget>
)Creates a new font picker widget.
- ret
- a new font picker widget.
Since 2.4
mchars
) ⇒ (ret <gtk-widget>
)Creates a new font picker widget.
- fontname
- Name of font to display in font selection dialog
- ret
- a new font picker widget.
Since 2.4
<gtk-font-button>
) (fontname mchars
) ⇒ (ret bool
)Sets or updates the currently-displayed font in font picker dialog.
- font-button
- a
<gtk-font-button>
- fontname
- Name of font to display in font selection dialog
- ret
- Return value of
gtk-font-selection-dialog-set-font-name
if the font selection dialog exists, otherwise ‘#f
’.Since 2.4
<gtk-font-button>
) ⇒ (ret mchars
)Retrieves the name of the currently selected font.
- font-button
- a
<gtk-font-button>
- ret
- an internal copy of the font name which must not be freed.
Since 2.4
<gtk-font-button>
) (show_style bool
)If show-style is ‘
#t
’, the font style will be displayed along with name of the selected font.
- font-button
- a
<gtk-font-button>
- show-style
- ‘
#t
’ if font style should be displayed in label.Since 2.4
<gtk-font-button>
) ⇒ (ret bool
)Returns whether the name of the font style will be shown in the label.
- font-button
- a
<gtk-font-button>
- ret
- whether the font style will be shown in the label.
Since 2.4
<gtk-font-button>
) (show_size bool
)If show-size is ‘
#t
’, the font size will be displayed along with the name of the selected font.
- font-button
- a
<gtk-font-button>
- show-size
- ‘
#t
’ if font size should be displayed in dialog.Since 2.4
<gtk-font-button>
) ⇒ (ret bool
)Returns whether the font size will be shown in the label.
- font-button
- a
<gtk-font-button>
- ret
- whether the font size will be shown in the label.
Since 2.4
<gtk-font-button>
) (use_font bool
)If use-font is ‘
#t
’, the font name will be written using the selected font.
- font-button
- a
<gtk-font-button>
- use-font
- If ‘
#t
’, font name will be written using font chosen.Since 2.4
<gtk-font-button>
) ⇒ (ret bool
)Returns whether the selected font is used in the label.
- font-button
- a
<gtk-font-button>
- ret
- whether the selected font is used in the label.
Since 2.4
<gtk-font-button>
) (use_size bool
)If use-size is ‘
#t
’, the font name will be written using the selected size.
- font-button
- a
<gtk-font-button>
- use-size
- If ‘
#t
’, font name will be written using the selected size.Since 2.4
<gtk-font-button>
) ⇒ (ret bool
)Returns whether the selected size is used in the label.
- font-button
- a
<gtk-font-button>
- ret
- whether the selected size is used in the label.
Since 2.4