My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
HFontPicker  
HFontPicker widget information
Updated Feb 4, 2010 by fr.dan...@gmail.com

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


  • code sample:
  • 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();
    	}
    }
Powered by Google Project Hosting