FontButton


Object Hierarchy:

Gtk.FontButton Gtk.FontButton Gtk.FontButton Gtk.Button Gtk.Button Gtk.Button->Gtk.FontButton Gtk.Bin Gtk.Bin Gtk.Bin->Gtk.Button Gtk.Container Gtk.Container Gtk.Container->Gtk.Bin Gtk.Widget Gtk.Widget Gtk.Widget->Gtk.Container GLib.InitiallyUnowned GLib.InitiallyUnowned GLib.InitiallyUnowned->Gtk.Widget GLib.Object GLib.Object GLib.Object->GLib.InitiallyUnowned Atk.Implementor Atk.Implementor Atk.Implementor->Gtk.FontButton Atk.Implementor->Gtk.Button Atk.Implementor->Gtk.Bin Atk.Implementor->Gtk.Container Atk.Implementor->Gtk.Widget Gtk.Buildable Gtk.Buildable Gtk.Buildable->Gtk.FontButton Gtk.Buildable->Gtk.Button Gtk.Buildable->Gtk.Bin Gtk.Buildable->Gtk.Container Gtk.Buildable->Gtk.Widget Gtk.Actionable Gtk.Actionable Gtk.Actionable->Gtk.FontButton Gtk.Actionable->Gtk.Button Gtk.Activatable Gtk.Activatable Gtk.Activatable->Gtk.FontButton Gtk.Activatable->Gtk.Button Gtk.FontChooser Gtk.FontChooser Gtk.FontChooser->Gtk.FontButton

Description:

[ CCode ( type_id = "gtk_font_button_get_type ()" ) ]
public class FontButton : Button, Implementor, Actionable, Activatable, Buildable, FontChooser

The FontButton is a button which displays the currently selected font an allows to open a font chooser dialog to change the font.

It is suitable widget for selecting a font in a preference dialog.

CSS nodes

GtkFontButton has a single CSS node with name button and style class .font.

GtkFontButton

Example: FontButton:

public class Application : Gtk.Window {

public Application () {
// Prepare Gtk.Window:
this.title = "My Gtk.FontButton";
this.window_position = Gtk.WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);

// The button:
Gtk.FontButton button = new Gtk.FontButton ();
this.add (button);

// Use the selected font & size to draw the button-label:
button.use_font = true;
button.use_size = true;

// Sets the title for the font chooser dialog:
button.set_title ("Pick your favourite font");

// Connect a signal:
button.font_set.connect (() => {
// Emitted when a font has been chosen:
unowned string name = button.get_font_name ();
print ("Selected font: %s\n", name);
});
}

public static int main (string[] args) {
Gtk.init (ref args);

Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}

valac --pkg gtk+-3.0 Gtk.FontButton.vala


Namespace: Gtk
Package: gtk+-3.0

Content:

Properties:

Creation methods:

Methods:

Signals:

Inherited Members:

All known members inherited from class Gtk.Bin
All known members inherited from class Gtk.Widget
All known members inherited from interface Atk.Implementor