using System; using Gtk; using Abiword; // Beware the filename must be specified e.g. like this: // file:///home/user/abiword/docs/AbiSourceCodeGuidelines.a namespace testwidget { class MainClass { public static void OnBold ( object o, Abiword.BoldArgs args ) { Console.WriteLine ( "Bold set" ); } public static void OnMapEvent ( object o, System.EventArgs e ) { //(o as AbiWidget).SetZoomPercentage ( 100 ); } public static void Main ( string[] args ) { Application.Init (); Window window = new Window ( "Hello abiworld" ); window.SetDefaultSize ( 640, 480 ); window.DeleteEvent += OnDelete; // Now load the abiword widget AbiWidget.Init (); AbiWidget abi = new AbiWidget (); abi.MapEvent += new Gtk.MapEventHandler ( OnMapEvent ); abi.Bold += OnBold; if ( args.Length != 0 ) { Console.WriteLine ( "Loading file: " + args[0] ); abi.LoadFile ( args[0], "" ); } window.Add ( abi ); window.ShowAll (); Application.Run (); AbiWidget.Shutdown (); } static void OnDelete ( object obj, DeleteEventArgs args ) { Application.Quit (); } } }