Gtk.FontButton¶
Example¶
 
- Subclasses:
- None 
Methods¶
- Inherited:
- Gtk.Widget (183), GObject.Object (37), Gtk.Accessible (17), Gtk.Buildable (1), Gtk.FontChooser (19) 
- Structs:
| class | 
 | 
| class | 
 | 
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | |
| 
 | 
Virtual Methods¶
Properties¶
- Inherited:
| Name | Type | Flags | Short Description | 
|---|---|---|---|
| r/w/en | |||
| r/w | |||
| r/w/en | |||
| r/w/en | 
Signals¶
- Inherited:
| Name | Short Description | 
|---|---|
| Emitted to when the font button is activated. | |
| Emitted when the user selects a font. | 
Fields¶
- Inherited:
Class Details¶
- class Gtk.FontButton(**kwargs)¶
- Bases:
- Abstract:
- No 
 - The - GtkFontButtonallows to open a font chooser dialog to change the font.- <picture> <source srcset=”font-button-dark.png” media=”(prefers-color-scheme: dark)”> <img alt=”An example - Gtk.FontButton" src=”font-button.png”> </picture>- It is suitable widget for selecting a font in a preference dialog. - CSS nodes
 - `` fontbutton ╰── button.font - ╰── [content] - GtkFontButtonhas a single CSS node with name fontbutton which contains a button node with the .font style class.- Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead - classmethod new()[source]¶
- Returns:
- a new font picker widget. 
- Return type:
 - Creates a new font picker widget. - Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead 
 - classmethod new_with_font(fontname)[source]¶
- Parameters:
- fontname ( - str) – Name of font to display in font chooser dialog
- Returns:
- a new font picker widget. 
- Return type:
 - Creates a new font picker widget showing the given font. - Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead 
 - get_modal()[source]¶
- 
Gets whether the dialog is modal. Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead 
 - get_title()[source]¶
- Returns:
- an internal copy of the title string which must not be freed. 
- Return type:
 - Retrieves the title of the font chooser dialog. - Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead 
 - get_use_font()[source]¶
- Returns:
- whether the selected font is used in the label. 
- Return type:
 - Returns whether the selected font is used in the label. - Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead 
 - get_use_size()[source]¶
- Returns:
- whether the selected size is used in the label. 
- Return type:
 - Returns whether the selected size is used in the label. - Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead 
 - set_modal(modal)[source]¶
- 
Sets whether the dialog should be modal. Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead 
 - set_title(title)[source]¶
- Parameters:
- title ( - str) – a string containing the font chooser dialog title
 - Sets the title for the font chooser dialog. - Deprecated since version 4.10: Use [class`Gtk`.FontDialogButton] instead 
 
Signal Details¶
- Gtk.FontButton.signals.activate(font_button)¶
- Signal Name:
- activate
- Flags:
- Parameters:
- font_button ( - Gtk.FontButton) – The object which received the signal
 - Emitted to when the font button is activated. - The - ::activatesignal on- GtkFontButtonis an action signal and emitting it causes the button to present its dialog.- New in version 4.4. 
- Gtk.FontButton.signals.font_set(font_button)¶
- Signal Name:
- font-set
- Flags:
- Parameters:
- font_button ( - Gtk.FontButton) – The object which received the signal
 - Emitted when the user selects a font. - When handling this signal, use [method`Gtk`.FontChooser.get_font] 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 signal. 
Property Details¶
- Gtk.FontButton.props.modal¶
- Name:
- modal
- Type:
- Default Value:
- Flags:
 - Whether the font chooser dialog should be modal. 
- Gtk.FontButton.props.title¶
- 
The title of the font chooser dialog. 
- Gtk.FontButton.props.use_font¶
- Name:
- use-font
- Type:
- Default Value:
- Flags:
 - Whether the buttons label will be drawn in the selected font.