A button to launch a font selection dialog.
Class GtkFontButton
The GtkFontButton 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.
Methods | |
get_font_name | Retrieves the name of the currently selected font. |
get_show_size | Returns whether the font size will be shown in the label. |
get_show_style | Returns whether the name of the font style will be shown in the label. |
get_title | Retrieves the title of the font selection dialog. |
get_use_font | Returns whether the selected font is used in the label. |
get_use_size | Returns whether the selected size is used in the label. |
new_with_font | Creates a new font picker widget. |
set_font_name | Sets or updates the currently-displayed font in font picker dialog. |
set_show_size | If show_size is TRUE, the font size will be displayed along with the name of the selected font. |
set_show_style | If show_style is TRUE, the font style will be displayed along with name of the selected font. |
set_title | Sets the title for the font selection dialog. |
set_use_font | If use_font is TRUE, the font name will be written using the selected font. |
set_use_size | If use_size is TRUE, the font name will be written using the selected size. |
signal_font_set | The font-set signal is emitted when the user selects a font. |
Retrieves the name of the currently selected font.
GtkFontButton.get_font_name()
Return | the font name. |
This name includes style and size information as well. If you want to render something with the font, use this string with pango_font_description_from_string(). If you're interested in peeking certain values (family name, style, size, weight) just query these properties from the PangoFontDescription object.
Returns whether the font size will be shown in the label.
GtkFontButton.get_show_size()
Return | whether the font size will be shown in the label. |
Returns whether the name of the font style will be shown in the label.
GtkFontButton.get_show_style()
Return | whether the font style will be shown in the label. |
Retrieves the title of the font selection dialog.
GtkFontButton.get_title()
Return | the title string |
Returns whether the selected font is used in the label.
GtkFontButton.get_use_font()
Return | whether the selected font is used in the label. |
Returns whether the selected size is used in the label.
GtkFontButton.get_use_size()
Return | whether the selected size is used in the label. |
Creates a new font picker widget.
GtkFontButton.new_with_font( fontname )
fontname | Name of font to display in font selection dialog |
Return | a new font picker widget. |
Sets or updates the currently-displayed font in font picker dialog.
GtkFontButton.set_font_name( fontname )
fontname | Name of font to display in font selection dialog |
Return | Return value of gtk_font_selection_dialog_set_font_name() if the font selection dialog exists, otherwise FALSE. |
If show_size is TRUE, the font size will be displayed along with the name of the selected font.
GtkFontButton.set_show_size( show_size )
show_size | TRUE if font size should be displayed in dialog. |
If show_style is TRUE, the font style will be displayed along with name of the selected font.
GtkFontButton.set_show_style( show_style )
show_style | TRUE if font style should be displayed in label. |
Sets the title for the font selection dialog.
GtkFontButton.set_title( title )
title | a string containing the font selection dialog title |
If use_font is TRUE, the font name will be written using the selected font.
GtkFontButton.set_use_font( use_font )
use_font | If TRUE, font name will be written using font chosen. |
If use_size is TRUE, the font name will be written using the selected size.
GtkFontButton.set_use_size( use_size )
use_size | If TRUE, font name will be written using the selected size. |
The font-set signal is emitted when the user selects a font.
GtkFontButton.signal_font_set()
When handling this signal, use 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.