Xfce Foundation Classes
Main Page | Index | Namespace List | Alphabetical List | Class List | File List

# Xfc::Gtk::FontSelection Class Reference

A GtkFontSelection C++ wrapper class. More...

`#include <xfc/gtk/fontselection.hh>`

Inheritance diagram for Xfc::Gtk::FontSelection:

List of all members.

## Public Member Functions

Constructors

- FontSelection ()
    Construct a new FontSelection.
- virtual ~FontSelection ()
    Destructor.

Accessors

- GtkFontSelection * gtk_font_selection () const
    Get a pointer to the GtkFontSelection structure.
- operator GtkFontSelection * () const
    Conversion operator; safely converts a FontSelection to a GtkFontSelection pointer.
- Entry * size_entry () const
    Returns a pointer to the font size Entry.
- Entry * preview_entry () const
    Returns a pointer to the preview text Entry.
- Pango::FontFamily * get_font_family () const
    Gets the current font family.
- Pango::FontFace * get_font_face () const
    Gets the current font face.
- String get_font_name () const
    Gets the currently selected font name.
- String get_preview_text () const
    Gets the text displayed in the preview area.

Methods

- bool set_font_name (const String &fontname)
    Sets the currently selected font.
- void set_preview_text (const String &text)
    Sets the text displayed in the preview area.

## Protected Member Functions

Constructors

- FontSelection (GtkFontSelection *font_selection, bool owns_reference=false)
    Construct a new FontSelection from an existing GtkFontSelection.

## Detailed Description

A GtkFontSelection C++ wrapper class.

The FontSelection widget lists the available fonts, styles and sizes, allowing the user to select a font. It is used in the FontSelectionDialog widget to provide a dialog box for selecting fonts.

To set the font which is initially selected, use set_font_name(). To get the selected font use get_font_name(). To change the text which is shown in the preview area, use set_preview_text().

See also: the Font Selection HOWTO and example.

## Constructor & Destructor Documentation

Xfc::Gtk::FontSelection::FontSelection | ( | GtkFontSelection * | font_selection,
|  | bool | owns_reference = `false`
| ) | `[explicit, protected]`

Construct a new FontSelection from an existing GtkFontSelection.

Parameters:

  | font_selection | A pointer to a GtkFontSelection.
  | owns_reference | Set false if the initial reference count is floating, set true if it's not.

The font_selection can be a newly created GtkFontSelection or an existing GtkFontSelection (see G::Object::Object).

## Member Function Documentation

bool Xfc::Gtk::FontSelection::set_font_name | ( | const String & | fontname | ) |

Sets the currently selected font.

Parameters:

  | fontname | A fontname.

Returns:
  true if the font was found.

void Xfc::Gtk::FontSelection::set_preview_text | ( | const String & | text | ) |

Sets the text displayed in the preview area.

Parameters:

  | text | The text to display in the preview area.

The documentation for this class was generated from the following file:

- fontselection.hh

Xfce Foundation Classes

Copyright © 2004-2005 The XFC Development Team | XFC 4.3