FontChooserWidget (Vala) Tiffany Antpoolski tiffany.antopolski@gmail.com 2013 Un élément graphique pour choisir une police Luc Rebert, traduc@rebert.name 2011 Alain Lojewski, allomervan@gmail.com 2011-2012 Luc Pionchon pionchon.luc@gmail.com 2011 Bruno Brouard annoa.b@gmail.com 2011-12 Luis Menina liberforce@freeside.fr 2014 Élément graphique GtkFontChooser

A FontChooserWidget with a lambda callback function.

Code utilisé pour générer cet exemple public class MyWindow : Gtk.ApplicationWindow { internal MyWindow (MyApplication app) { Object (application: app, title: "FontChooserWidget"); var font_chooser = new Gtk.FontChooserWidget (); font_chooser.set_font ("Sans"); font_chooser.set_preview_text ("This is an example of preview text!"); this.add (font_chooser); font_chooser.notify["font"].connect (() => { print ("font: %s\n", font_chooser.get_font ().to_string ()); print ("desc: %s\n", font_chooser.get_font_desc ().to_string ()); print ("face: %s\n", font_chooser.get_font_face ().get_face_name ()); print ("size: %d\n", font_chooser.get_font_size ()); print ("family: %s\n", font_chooser.get_font_family ().get_name ()); print ("monospace: %s\n\n", font_chooser.get_font_family ().is_monospace ().to_string ()); }); this.show_all (); } } public class MyApplication : Gtk.Application { protected override void activate () { new MyWindow (this).show (); } } public int main (string[] args) { return new MyApplication ().run (args); }
Références API

Dans cet exemple, les éléments suivants sont utilisés :

GtkFontChooserWidget