"fontsel"ReadThe gtk.FontSelection
widget in the dialog."main_vbox"ReadThe gtk.VBox that contains
all the dialog widgets"action_area"ReadThe gtk.HBox containing
the action buttons"ok_button"ReadThe OK button"apply_button"ReadThe Apply button"cancel_button"ReadThe Cancel button
DescriptionThe gtk.FontSelectionDialog
is a dialog box containing a gtk.FontSelection
widget that the user can use to select a font according to the desired
family, style and size.The set_font_name()
method sets the initial font selection. The current font selection is
retrieved using the get_font_name()
method. The font selection dialog has a preview area that contains a gtk.Entry that
displays text using the currently selected font. The preview text can be
retrieved with the get_preview_text()
method and set with the set_preview_text()
method.Filters can be used to limit the font selections. There are 2
filters in the gtk.FontSelectionDialog
- a base filter and a user filter. The base filter cannot be changed by the
user, so this can be used when the user must choose from the restricted set
of fonts (e.g. for a terminal-type application you may want to force the
user to select a fixed-width font). The user filter can be changed or reset
by the user, by using the Reset Filter button or
changing the options on the Filter page of the
widget.In GTK+ 2.2 and above the gtk.FontSelectionDialog
does not have filters, a Reset Filter button or a
Filter page.Constructorgtk.FontSelectionDialogtitletitle :a string to be used as the dialog
titleReturns :a new font selection dialogCreates a new gtk.FontSelectionDialog
with the title specified by title.Methodsgtk.FontSelectionDialog.get_font_nameget_font_nameReturns :the currently selected font name or None if no
font is selected.The get_font_name() method returns a
string containing the currently selected font name or None if no font name
is selected.gtk.FontSelectionDialog.set_font_nameset_font_namefontnamefontname :a string containing the font name to be
setReturns :TRUE if the font is found
and can be selectedThe set_font_name() method sets the
current font using the value of fontname. The method
returns TRUE if the font exists and could be
selected.gtk.FontSelectionDialog.get_preview_textget_preview_textReturns :a string containing the text in the preview
area entryThe get_preview_text() method returns a
string containing the text in the preview area entry.gtk.FontSelectionDialog.set_preview_textset_preview_texttexttext :a string used to set the text in the preview
area entryThe set_preview_text() method sets the
text in the preview area entry using the string specified by
text.