gtk.FontSelectionDialog a dialog for selecting fonts. Synopsis gtk.FontSelectionDialog gtk.Dialog gtk.FontSelectionDialog title get_font_name set_font_name fontname get_preview_text set_preview_text text Ancestry +-- gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.Window +-- gtk.Dialog +-- gtk.FontSelectionDialog Attributes
"fontsel" Read The gtk.FontSelection widget in the dialog. "main_vbox" Read The gtk.VBox that contains all the dialog widgets "action_area" Read The gtk.HBox containing the action buttons "ok_button" Read The OK button "apply_button" Read The Apply button "cancel_button" Read The Cancel button
Description The 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. Constructor gtk.FontSelectionDialog title title : a string to be used as the dialog title Returns : a new font selection dialog Creates a new gtk.FontSelectionDialog with the title specified by title. Methods gtk.FontSelectionDialog.get_font_name get_font_name Returns : 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_name set_font_name fontname fontname : a string containing the font name to be set Returns : TRUE if the font is found and can be selected The 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_text get_preview_text Returns : a string containing the text in the preview area entry The get_preview_text() method returns a string containing the text in the preview area entry. gtk.FontSelectionDialog.set_preview_text set_preview_text text text : a string used to set the text in the preview area entry The set_preview_text() method sets the text in the preview area entry using the string specified by text.