FontButton
Object Hierarchy:
Description:
[ CCode ( type_id = "gtk_font_button_get_type ()" ) ]
public class FontButton : Button, Implementor, Actionable, Activatable, Buildable, FontChooser
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.
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.Button
All known members inherited from class Gtk.Bin
All known members inherited from class Gtk.Container
All known members inherited from class Gtk.Widget
All known members inherited from class GLib.Object
All known members inherited from interface Atk.Implementor
All known members inherited from interface Gtk.Actionable
All known members inherited from interface Gtk.Activatable
All known members inherited from interface Gtk.Buildable
All known members inherited from interface Gtk.FontChooser