Crea  Modifica  FrontPage  Indici  Cerca  Ultime modifiche  History  RSS  Login

Gtk::FontSelection

class Gtk::FontSelection

The Gtk::FontSelection widget lists the available fonts, styles and sizes, allowing the user to select a font. It is used in the Gtk::FontSelectionDialog widget to provide a dialog box for selecting fonts. To set the font which is initially selected, use Gtk::FontSelection#font_name=. To get the selected font use Gtk::FontSelection#font_name. To change the text which is shown in the preview area, use Gtk::FontSelection#preview_text=.

Filters can be used to limit the fonts shown. There are 2 filters in the Gtk::FontSelection - a base filter and a user filter. The base filter can not 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.

Instance Methods

font_name
Gets the currently-selected font name.
  • Returns: the font name.
font_name=(name)
Sets the currently-selected font.
  • name : a fontname.
  • Returns: name
set_font_name
Same as Gtk::FontSelection#font_name=.
  • name : a fontname.
  • Returns: self
preview_text
Gets the text displayed in the preview area.
  • Returns: the text displayed in the preview area.
preview_text=(text)
Sets the text displayed in the preview area.
  • text: the text to display in the preview area.
set_preview_text(text)
Same as Gtk::FontSelection#preview_text=.
  • text: the text to display in the preview area.

Properties

font: #<Class 0lxa2d3158> (Read)
The Gdk::Font? that is currently selected
font-name: String (Read/Write)
The X string that represents this font
preview-text: String (Read/Write)
The text to display in order to demonstrate the selected font
Ultima modifica:2005/11/17 02:43:41
Parola chiave:
Referenze:[Gtk::FontSelection] [Gtk::FontSelectionDialog]