Gnm.FontButton

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Actionable Gtk.Actionable GObject.GInterface->Gtk.Actionable Gtk.Activatable Gtk.Activatable GObject.GInterface->Gtk.Activatable Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.FontChooser Gtk.FontChooser GObject.GInterface->Gtk.FontChooser GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gnm.FontButton Gnm.FontButton Gtk.Button Gtk.Button Gtk.Actionable->Gtk.Button Gtk.Activatable->Gtk.Button Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.Button Gtk.Buildable->Gtk.Widget Gtk.Button->Gnm.FontButton Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.FontChooser->Gnm.FontButton Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Button (29), Gtk.Bin (1), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Actionable (5), Gtk.Activatable (6), Gtk.FontChooser (19)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new ()

class

new_with_font (fontname)

get_font_name ()

get_show_size ()

get_show_style ()

get_title ()

get_use_font ()

get_use_size ()

set_font_name (fontname)

set_show_size (show_size)

set_show_style (show_style)

set_title (title)

set_use_font (use_font)

set_use_size (use_size)

Virtual Methods

Inherited:

Gtk.Button (6), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Actionable (4), Gtk.Activatable (2), Gtk.FontChooser (7)

do_font_set ()

Properties

Inherited:

Gtk.Button (9), Gtk.Container (3), Gtk.Widget (39), Gtk.Actionable (2), Gtk.Activatable (2), Gtk.FontChooser (7)

Name

Type

Flags

Short Description

dialog-type

GObject.GType

r/w

The type of the dialog

font-name

str

r/w

The name of the selected Gnm.font

show-size

bool

r/w

Whether selected Gnm.font size is shown in the label

show-style

bool

r/w

Whether the selected Gnm.font style is shown in the label

title

str

r/w

The title of the Gnm.font chooser dialog

use-font

bool

r/w

Whether the label is drawn in the selected Gnm.font

use-size

bool

r/w

Whether the label is drawn with the selected Gnm.font size

Style Properties

Inherited:

Gtk.Button (7), Gtk.Widget (17)

Signals

Inherited:

Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.FontChooser (1)

Name

Short Description

font-set

The ::font-set signal is emitted when the user selects a Gnm.font.

Fields

Inherited:

Gtk.Button (6), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.FontChooser (1)

Name

Type

Access

Description

button

Gtk.Button

r

Class Details

class Gnm.FontButton(*args, **kwargs)
Bases:

Gtk.Button, Gtk.FontChooser

Abstract:

No

Structure:

Gnm.FontButtonClass

classmethod new()
Returns:

a new Gnm.font picker widget.

Return type:

Gtk.Widget

Creates a new Gnm.font picker widget.

New in version 2.4.

classmethod new_with_font(fontname)
Parameters:

fontname (str) – Name of Gnm.font to display in Gnm.font chooser dialog

Returns:

a new Gnm.font picker widget.

Return type:

Gtk.Widget

Creates a new Gnm.font picker widget.

New in version 2.4.

get_font_name()
Returns:

an internal copy of the Gnm.font name which must not be freed.

Return type:

str

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

New in version 2.4.

get_show_size()
Returns:

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

Return type:

bool

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

New in version 2.4.

get_show_style()
Returns:

whether the Gnm.font style will be shown in the label.

Return type:

bool

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

New in version 2.4.

get_title()
Returns:

an internal copy of the title string which must not be freed.

Return type:

str

Retrieves the title of the Gnm.font chooser dialog.

New in version 2.4.

get_use_font()
Returns:

whether the selected Gnm.font is used in the label.

Return type:

bool

Returns whether the selected Gnm.font is used in the label.

New in version 2.4.

get_use_size()
Returns:

whether the selected size is used in the label.

Return type:

bool

Returns whether the selected size is used in the label.

New in version 2.4.

set_font_name(fontname)
Parameters:

fontname (str) – Name of Gnm.font to display in Gnm.font chooser dialog

Returns:

True

Return type:

bool

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

New in version 2.4.

set_show_size(show_size)
Parameters:

show_size (bool) – True if Gnm.font size should be displayed in dialog.

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

New in version 2.4.

set_show_style(show_style)
Parameters:

show_style (bool) – True if Gnm.font style should be displayed in label.

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

New in version 2.4.

set_title(title)
Parameters:

title (str) – a string containing the Gnm.font chooser dialog title

Sets the title for the Gnm.font chooser dialog.

New in version 2.4.

set_use_font(use_font)
Parameters:

use_font (bool) – If True, Gnm.font name will be written using Gnm.font chosen.

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

New in version 2.4.

set_use_size(use_size)
Parameters:

use_size (bool) – If True, Gnm.font name will be written using the selected size.

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

New in version 2.4.

do_font_set() virtual

Signal Details

Gnm.FontButton.signals.font_set(font_button)
Signal Name:

font-set

Flags:

RUN_FIRST

Parameters:

font_button (Gnm.FontButton) – The object which received the signal

The ::font-set signal is emitted when the user selects a Gnm.font. When handling this signal, use Gnm.FontButton.get_font_name() to find out which Gnm.font was just selected.

Note that this signal is only emitted when the user changes the Gnm.font. If you need to react to programmatic Gnm.font changes as well, use the notify::font-name signal.

New in version 2.4.

Property Details

Gnm.FontButton.props.dialog_type
Name:

dialog-type

Type:

GObject.GType

Default Value:

<GType GtkFontChooser>

Flags:

READABLE, WRITABLE

The type of the dialog

Gnm.FontButton.props.font_name
Name:

font-name

Type:

str

Default Value:

'Sans 12'

Flags:

READABLE, WRITABLE

The name of the currently selected Gnm.font.

New in version 2.4.

Gnm.FontButton.props.show_size
Name:

show-size

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

If this property is set to True, the selected Gnm.font size will be shown in the label. For a more WYSIWYG way to show the selected size, see the ::use-size property.

New in version 2.4.

Gnm.FontButton.props.show_style
Name:

show-style

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

If this property is set to True, the name of the selected Gnm.font style will be shown in the label. For a more WYSIWYG way to show the selected style, see the ::use-font property.

New in version 2.4.

Gnm.FontButton.props.title
Name:

title

Type:

str

Default Value:

'Pick a Font'

Flags:

READABLE, WRITABLE

The title of the Gnm.font chooser dialog.

New in version 2.4.

Gnm.FontButton.props.use_font
Name:

use-font

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If this property is set to True, the label will be drawn in the selected Gnm.font.

New in version 2.4.

Gnm.FontButton.props.use_size
Name:

use-size

Type:

bool

Default Value:

False

Flags:

READABLE, WRITABLE

If this property is set to True, the label will be drawn with the selected Gnm.font size.

New in version 2.4.