# Gtk::FontSelectionDialog Class Reference
[Dialogs]

A dialog box for selecting fonts. More...

Inherits Gtk::Dialog.

Collaboration diagram for Gtk::FontSelectionDialog:
[legend]

List of all members.

## Public Member Functions
virtual | ~FontSelectionDialog ()
GtkFontSelectionDialog* | gobj ()
| Provides access to the underlying C GtkObject.
const GtkFontSelectionDialog* | gobj () const
| Provides access to the underlying C GtkObject.
| FontSelectionDialog ()
| FontSelectionDialog (const Glib::ustring& title)
bool | set_font_name (const Glib::ustring& fontname)
| Sets the currently selected font.
Glib::ustring | get_font_name () const
| Gets the currently-selected font name.
Glib::ustring | get_preview_text () const
| Gets the text displayed in the preview area.
void | set_preview_text (const Glib::ustring& fontname)
| Sets the text displayed in the preview area.
Button* | get_ok_button ()
| Gets the 'OK' button.
const Button* | get_ok_button () const
| Gets the 'OK' button.
Button* | get_cancel_button ()
| Gets the 'Cancel' button.
const Button* | get_cancel_button () const
| Gets the 'Cancel' button.
Button* | get_apply_button ()
| Obtains a button.
const Button* | get_apply_button () const
| Obtains a button.
## Related Functions
(Note that these are not member functions.)
Gtk::FontSelectionDialog* | wrap (GtkFontSelectionDialog* object, bool take_copy=false)
| A Glib::wrap() method for this object.

## Detailed Description

A dialog box for selecting fonts.

The Gtk::FontSelectionDialog widget is a dialog box for selecting a font.

A FontSelectionDialog looks like this:

## Constructor & Destructor Documentation

virtual Gtk::FontSelectionDialog::~FontSelectionDialog | ( |  | ) | `[virtual]`

Gtk::FontSelectionDialog::FontSelectionDialog | ( |  | ) |

Gtk::FontSelectionDialog::FontSelectionDialog | ( | const Glib::ustring & | title | ) | `[explicit]`

## Member Function Documentation

const Button* Gtk::FontSelectionDialog::get_apply_button | ( |  | ) | const

Obtains a button.

The button doesn't have any function.

Since gtkmm 2.14:

Deprecated: 2.16: Don't use this function.

Returns:
  A Gtk::Widget.

Button* Gtk::FontSelectionDialog::get_apply_button | ( |  | ) |

Obtains a button.

The button doesn't have any function.

Since gtkmm 2.14:

Deprecated: 2.16: Don't use this function.

Returns:
  A Gtk::Widget.

const Button* Gtk::FontSelectionDialog::get_cancel_button | ( |  | ) | const

Gets the 'Cancel' button.

Since gtkmm 2.14:

Returns:
  The Gtk::Widget used in the dialog for the 'Cancel' button.

Button* Gtk::FontSelectionDialog::get_cancel_button | ( |  | ) |

Gets the 'Cancel' button.

Since gtkmm 2.14:

Returns:
  The Gtk::Widget used in the dialog for the 'Cancel' button.

Glib::ustring Gtk::FontSelectionDialog::get_font_name | ( |  | ) | const

Gets the currently-selected font name.

Note that this can be a different string than what you set with set_font_name(), as the font selection widget may normalize font names and thus return a string with a different structure. For example, "Helvetica Italic Bold 12" could be normalized to "Helvetica Bold Italic 12". Use pango_font_description_equal() if you want to compare two font descriptions.

Returns:
  A string with the name of the current font, or `0` if no font is selected. You must free this string with Glib::free().

const Button* Gtk::FontSelectionDialog::get_ok_button | ( |  | ) | const

Gets the 'OK' button.

Since gtkmm 2.14:

Returns:
  The Gtk::Widget used in the dialog for the 'OK' button.

Button* Gtk::FontSelectionDialog::get_ok_button | ( |  | ) |

Gets the 'OK' button.

Since gtkmm 2.14:

Returns:
  The Gtk::Widget used in the dialog for the 'OK' button.

Glib::ustring Gtk::FontSelectionDialog::get_preview_text | ( |  | ) | const

Gets the text displayed in the preview area.

Returns:
  The text displayed in the preview area. This string is owned by the widget and should not be modified or freed.

const GtkFontSelectionDialog* Gtk::FontSelectionDialog::gobj | ( |  | ) | const`[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Dialog.

GtkFontSelectionDialog* Gtk::FontSelectionDialog::gobj | ( |  | ) | `[inline]`

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Dialog.

bool Gtk::FontSelectionDialog::set_font_name | ( | const Glib::ustring & | fontname | ) |

Sets the currently selected font.

Parameters:

  | fontname | A font name like "Helvetica 12" or "Times Bold 18".

Returns:
  `true` if the font selected in fsd is now the fontname specified, `false` otherwise.

void Gtk::FontSelectionDialog::set_preview_text | ( | const Glib::ustring & | fontname | ) |

Sets the text displayed in the preview area.

Parameters:

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

## Friends And Related Function Documentation

Gtk::FontSelectionDialog* wrap | ( | GtkFontSelectionDialog * | object,
|  | bool | take_copy = `false` |
| ) |  |  | `[related]`

A Glib::wrap() method for this object.

Parameters:

  | object | The C instance.
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

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

- gtkmm/fontselection.h