gtkmm: Gtk::FontButton Class Reference

A button to launch a font selection dialog. More...

Inheritance diagram for Gtk::FontButton:
Collaboration diagram for Gtk::FontButton:

List of all members.

Public Member Functions

virtual ~FontButton ()
GtkFontButton* gobj ()
 Provides access to the underlying C GtkObject.

const GtkFontButton* gobj () const
 Provides access to the underlying C GtkObject.

 FontButton ()
 FontButton (const Glib::ustring& font_name)
Glib::ustring get_title () const
 Retrieves the title of the font selection dialog.

void set_title (const Glib::ustring& title)
 Sets the title for the font selection dialog.

bool get_use_font () const
 Returns whether the selected font is used in the label.

void set_use_font (bool use_font=true)
 If use_font is true, the font name will be written using the selected font.

bool get_use_size () const
 Returns whether the selected size is used in the label.

void set_use_size (bool use_size=true)
 If use_size is true, the font name will be written using the selected size.

Glib::ustring get_font_name () const
 Retrieves the name of the currently selected font.

bool set_font_name (const Glib::ustring& fontname)
 Sets or updates the currently-displayed font in font picker dialog.

bool get_show_style () const
 Returns whether the name of the font style will be shown in the label.

void set_show_style (bool show_style=true)
 If show_style is true, the font style will be displayed along with name of the selected font.

bool get_show_size () const
 Returns whether the font size will be shown in the label.

void set_show_size (bool show_size=true)
 If show_size is true, the font size will be displayed along with the name of the selected font.

Glib::PropertyProxy

< Glib::ustring
property_title ()
 The title of the font selection dialog.

Glib::PropertyProxy_ReadOnly

< Glib::ustring
property_title () const
 The title of the font selection dialog.

Glib::PropertyProxy

< Glib::ustring
property_font_name ()
 The name of the selected font.

Glib::PropertyProxy_ReadOnly

< Glib::ustring
property_font_name () const
 The name of the selected font.

Glib::PropertyProxy< bool > property_use_font ()
 Whether the label is drawn in the selected font.

Glib::PropertyProxy_ReadOnly

< bool > 
property_use_font () const
 Whether the label is drawn in the selected font.

Glib::PropertyProxy< bool > property_use_size ()
 Whether the label is drawn with the selected font size.

Glib::PropertyProxy_ReadOnly

< bool > 
property_use_size () const
 Whether the label is drawn with the selected font size.

Glib::PropertyProxy< bool > property_show_style ()
 Whether the selected font style is shown in the label.

Glib::PropertyProxy_ReadOnly

< bool > 
property_show_style () const
 Whether the selected font style is shown in the label.

Glib::PropertyProxy< bool > property_show_size ()
 Whether selected font size is shown in the label.

Glib::PropertyProxy_ReadOnly

< bool > 
property_show_size () const
 Whether selected font size is shown in the label.

Glib::SignalProxy0< void > signal_font_set ()
 The font_set signal is emitted when the user selects a font.

Protected Member Functions

virtual void on_font_set ()

Related Functions

(Note that these are not member functions.)

Gtk::FontButtonwrap (GtkFontButton* object, bool take_copy=false)
 A Glib::wrap() method for this object.


Detailed Description

A button to launch a font selection dialog.

The Gtk::FontButton is a button which displays the currently selected font and allows to open a font selection dialog to change the font. It is suitable widget for selecting a font in a preference dialog.

The FontButton widget looks like this:

fontbutton1.png

Constructor & Destructor Documentation

virtual Gtk::FontButton::~FontButton ( ) [virtual]
Gtk::FontButton::FontButton ( )
Gtk::FontButton::FontButton ( const Glib::ustring font_name) [explicit]

Member Function Documentation

Glib::ustring Gtk::FontButton::get_font_name ( ) const

Retrieves the name of the currently selected font.

This name includes style and size information as well. If you want to render something with the font, use this string with pango_font_description_from_string() . If you're interested in peeking certain values (family name, style, size, weight) just query these properties from the Pango::FontDescription object.

Since gtkmm 2.4:
Returns:
An internal copy of the font name which must not be freed.
bool Gtk::FontButton::get_show_size ( ) const

Returns whether the font size will be shown in the label.

Since gtkmm 2.4:
Returns:
Whether the font size will be shown in the label.
bool Gtk::FontButton::get_show_style ( ) const

Returns whether the name of the font style will be shown in the label.

Since gtkmm 2.4:
Returns:
Whether the font style will be shown in the label.
Glib::ustring Gtk::FontButton::get_title ( ) const

Retrieves the title of the font selection dialog.

Since gtkmm 2.4:
Returns:
An internal copy of the title string which must not be freed.
bool Gtk::FontButton::get_use_font ( ) const

Returns whether the selected font is used in the label.

Since gtkmm 2.4:
Returns:
Whether the selected font is used in the label.
bool Gtk::FontButton::get_use_size ( ) const

Returns whether the selected size is used in the label.

Since gtkmm 2.4:
Returns:
Whether the selected size is used in the label.
GtkFontButton* Gtk::FontButton::gobj ( ) [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Button.

const GtkFontButton* Gtk::FontButton::gobj ( ) const [inline]

Provides access to the underlying C GtkObject.

Reimplemented from Gtk::Button.

virtual void Gtk::FontButton::on_font_set ( ) [protected, virtual]
Glib::PropertyProxy<Glib::ustring> Gtk::FontButton::property_font_name ( )

The name of the selected font.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::FontButton::property_font_name ( ) const

The name of the selected font.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly<bool> Gtk::FontButton::property_show_size ( ) const

Whether selected font size is shown in the label.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy<bool> Gtk::FontButton::property_show_size ( )

Whether selected font size is shown in the label.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy<bool> Gtk::FontButton::property_show_style ( )

Whether the selected font style is shown in the label.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly<bool> Gtk::FontButton::property_show_style ( ) const

Whether the selected font style is shown in the label.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy<Glib::ustring> Gtk::FontButton::property_title ( )

The title of the font selection dialog.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::FontButton::property_title ( ) const

The title of the font selection dialog.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy<bool> Gtk::FontButton::property_use_font ( )

Whether the label is drawn in the selected font.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly<bool> Gtk::FontButton::property_use_font ( ) const

Whether the label is drawn in the selected font.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy_ReadOnly<bool> Gtk::FontButton::property_use_size ( ) const

Whether the label is drawn with the selected font size.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
Glib::PropertyProxy<bool> Gtk::FontButton::property_use_size ( )

Whether the label is drawn with the selected font size.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.
bool Gtk::FontButton::set_font_name ( const Glib::ustring fontname)

Sets or updates the currently-displayed font in font picker dialog.

Since gtkmm 2.4:
Parameters:
fontnameName of font to display in font selection dialog.
Returns:
Return value of Gtk::FontSelectionDialog::set_font_name() if the font selection dialog exists, otherwise false.
void Gtk::FontButton::set_show_size ( bool  show_size = true)

If show_size is true, the font size will be displayed along with the name of the selected font.

Since gtkmm 2.4:
Parameters:
show_sizetrue if font size should be displayed in dialog.
void Gtk::FontButton::set_show_style ( bool  show_style = true)

If show_style is true, the font style will be displayed along with name of the selected font.

Since gtkmm 2.4:
Parameters:
show_styletrue if font style should be displayed in label.
void Gtk::FontButton::set_title ( const Glib::ustring title)

Sets the title for the font selection dialog.

Since gtkmm 2.4:
Parameters:
titleA string containing the font selection dialog title.
void Gtk::FontButton::set_use_font ( bool  use_font = true)

If use_font is true, the font name will be written using the selected font.

Since gtkmm 2.4:
Parameters:
use_fontIf true, font name will be written using font chosen.
void Gtk::FontButton::set_use_size ( bool  use_size = true)

If use_size is true, the font name will be written using the selected size.

Since gtkmm 2.4:
Parameters:
use_sizeIf true, font name will be written using the selected size.
Glib::SignalProxy0< void > Gtk::FontButton::signal_font_set ( )

The font_set signal is emitted when the user selects a font.

When handling this signal, use get_font_name() to find out which font was just selected.

Prototype:
void on_my_font_set()

Friends And Related Function Documentation

Gtk::FontButton* wrap ( GtkFontButton *  object,
bool  take_copy = false 
) [related]

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

Parameters:
objectThe C instance.
take_copyFalse 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/fontbutton.h