Introduction
This widget is an office like font picker.
Details
Methods:
| void | ShowPopup() | - | shows the font popup |
Properties:
| string | Font | gets/sets the current selected font |
Events:
| FontEventHandler | FontChange | - raised when the current font changes |
using HollyLibrary;
using Gtk;
public class MainWin : Gtk.Window
{
public MainWin() : base(Gtk.WindowType.Toplevel)
{
this.DeleteEvent += new Gtk.DeleteEventHandler( this.OnDeleteEvent );
//create the picker widget
HFontPicker picker = new HFontPicker();
picker.FontChange += new FontEventHandler( this.OnFontChange );
//add the widget to the window
this.add( picker );
//show window
this.ShowAll();
}
protected virtual void OnFontChange (object sender, FontEventArgs args)
{
Console.WriteLine( "font changed to:" + args.Font );
}
protected virtual void OnDeleteEvent (object o, Gtk.DeleteEventArgs args)
{
Gtk.Application.Quit();
args.RetVal = true;
}
public static void Main (string[] args)
{
Gdk.Threads.Init ();
Application.Init ();
MainWin win = new MainWin();
win.Show ();
Gdk.Threads.Enter();
Application.Run ();
Gdk.Threads.Leave();
}
}