1.78 <GtkFontDialogButton>

Class: <GtkFontDialogButton>

It derives from <GtkWidget>.

Opens a font chooser dialog to select a font.

It is suitable widget for selecting a font in a preference dialog.

CSS nodes

fontbutton
╰── button.font
    ╰── [content]

<GtkFontDialogButton> has a single CSS node with name fontbutton which contains a button node with the .font style class.

Properties

Property: font-dialog-button:dialog self

The <GtkFontDialog> that contains parameters for the font chooser dialog.

Its value is a <GtkFontDialog>, or #f.

Set it with (set! (font-dialog-button:dialog self) value).

Property: font-dialog-button:font-desc self

The selected font.

This property can be set to give the button its initial font, and it will be updated to reflect the users choice in the font chooser dialog.

Listen to notify::font-desc to get informed about changes to the buttons font.

Its value is a <PangoFontDescription>, or #f.

Set it with (set! (font-dialog-button:font-desc self) value).

Property: font-dialog-button:font-features self

The selected font features.

This property will be updated to reflect the users choice in the font chooser dialog.

Listen to notify::font-features to get informed about changes to the buttons font features.

Its value is a string, or #f.

Set it with (set! (font-dialog-button:font-features self) value).

Property: font-dialog-button:language self

The selected language for font features.

This property will be updated to reflect the users choice in the font chooser dialog.

Listen to notify::language to get informed about changes to the buttons language.

Its value is a <PangoLanguage>, or #f.

Set it with (set! (font-dialog-button:language self) value).

Property: font-dialog-button:level self

The level of detail for the font chooser dialog.

Its value is a <GtkFontLevel> (or, to set it, one of its symbols).

Set it with (set! (font-dialog-button:level self) value).

Property: font-dialog-button:use-font self

Whether the buttons label will be drawn in the selected font.

Its value is a boolean.

Set it with (set! (font-dialog-button:use-font self) value).

Property: font-dialog-button:use-size self

Whether the buttons label will use the selected font size.

Its value is a boolean.

Set it with (set! (font-dialog-button:use-size self) value).

Procedures

Method: font-dialog-button:get-dialog self ⇒ %return
Method: get-dialog self ⇒ %return

Returns the <GtkFontDialog> of self.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

%return

Returned: a <GtkFontDialog>, or #f.

the <GtkFontDialog>

Method: font-dialog-button:get-font-desc self ⇒ %return
Method: get-font-desc self ⇒ %return

Returns the font of the button.

This function is what should be used to obtain the font that was chosen by the user. To get informed about changes, listen to "notify::font-desc".

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

%return

Returned: a <PangoFontDescription>, or #f.

the font

Method: font-dialog-button:get-font-features self ⇒ %return
Method: get-font-features self ⇒ %return

Returns the font features of the button.

This function is what should be used to obtain the font features that were chosen by the user. To get informed about changes, listen to "notify::font-features".

Note that the button will only let users choose font features if font-dialog-button:level is set to features.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

%return

Returned: a string, or #f.

the font features

Method: font-dialog-button:get-language self ⇒ %return
Method: get-language self ⇒ %return

Returns the language that is used for font features.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

%return

Returned: a <PangoLanguage>, or #f.

the language

Method: font-dialog-button:get-level self ⇒ %return
Method: get-level self ⇒ %return

Returns the level of detail at which this dialog lets the user select fonts.

self

Passed: a <GtkFontDialogButton>.

a ‘GtkFontDialogButton

%return

Returned: a <GtkFontLevel>.

the level of detail

Method: font-dialog-button:get-use-font? self ⇒ %return
Method: get-use-font? self ⇒ %return

Returns whether the selected font is used in the label.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

%return

Returned: a boolean.

whether the selected font is used in the label

Method: font-dialog-button:get-use-size? self ⇒ %return
Method: get-use-size? self ⇒ %return

Returns whether the selected font size is used in the label.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

%return

Returned: a boolean.

whether the selected font size is used in the label

Procedure: font-dialog-button:new [dialog] ⇒ %return

Creates a new <GtkFontDialogButton> with the given <GtkFontDialog>.

You can pass NULL to this function and set a <GtkFontDialog> later. The button will be insensitive until that happens.

dialog

Passed, or left out: a <GtkFontDialog>, or #f.

the <GtkFontDialog> to use

%return

Returned: a <GtkWidget>.

the new <GtkFontDialogButton>

Method: font-dialog-button:set-dialog self dialog
Method: set-dialog self dialog

Sets a <GtkFontDialog> object to use for creating the font chooser dialog that is presented when the user clicks the button.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

dialog

Passed: a <GtkFontDialog>.

the new <GtkFontDialog>

Method: font-dialog-button:set-font-desc self font-desc
Method: set-font-desc self font-desc

Sets the font of the button.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

font-desc

Passed: a <PangoFontDescription>.

the new font

Method: font-dialog-button:set-font-features self [font-features]
Method: set-font-features self [font-features]

Sets the font features of the button.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

font-features

Passed, or left out: a string, or #f.

the font features

Method: font-dialog-button:set-language self [language]
Method: set-language self [language]

Sets the language to use for font features.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

language

Passed, or left out: a <PangoLanguage>, or #f.

the new language

Method: font-dialog-button:set-level self level
Method: set-level self level

Sets the level of detail at which this dialog lets the user select fonts.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

level

Passed: a <GtkFontLevel>, or one of its symbols.

the level of detail

Method: font-dialog-button:set-use-font self use-font
Method: set-use-font self use-font

If use-font is TRUE, the font name will be written using the selected font.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

use-font

Passed: a boolean.

If TRUE, font name will be written using the chosen font

Method: font-dialog-button:set-use-size self use-size
Method: set-use-size self use-size

If use-size is TRUE, the font name will be written using the selected font size.

self

Passed: a <GtkFontDialogButton>.

a <GtkFontDialogButton>

use-size

Passed: a boolean.

If TRUE, font name will be written using the chosen font size

Signals

Signal: font-dialog-button:activate

Connect a handler with (connect object font-dialog-button:activate handler). It is called as (handler self).

Emitted when the font dialog button is activated.

The ::activate signal on <GtkFontDialogButton> is an action signal and emitting it causes the button to pop up its dialog.

self

Passed: a <GtkFontDialogButton>.