2003-03-14 07:31:51 +00:00
|
|
|
//
|
|
|
|
// samples/rsvg/svghelloworkd.cs
|
|
|
|
//
|
|
|
|
// Author: Charles Iliya Krempeaux
|
|
|
|
//
|
2004-06-18 21:38:57 +00:00
|
|
|
using System;
|
|
|
|
using Gtk;
|
2003-03-14 07:31:51 +00:00
|
|
|
|
|
|
|
class SvgHelloWorld
|
|
|
|
{
|
2004-06-18 21:38:57 +00:00
|
|
|
static void Main (string[] args)
|
2003-03-14 07:31:51 +00:00
|
|
|
{
|
2004-06-18 21:38:57 +00:00
|
|
|
Application.Init ();
|
|
|
|
MyMainWindow app = new MyMainWindow ();
|
|
|
|
app.ShowAll ();
|
2003-03-14 07:31:51 +00:00
|
|
|
|
2004-06-18 21:38:57 +00:00
|
|
|
Application.Run ();
|
2003-03-14 07:31:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2004-06-18 21:38:57 +00:00
|
|
|
class MyMainWindow : Gtk.Window
|
2003-03-14 07:31:51 +00:00
|
|
|
{
|
2004-06-18 21:38:57 +00:00
|
|
|
public MyMainWindow () : base ("SVG Hello World")
|
2003-03-14 07:31:51 +00:00
|
|
|
{
|
2004-02-10 20:35:40 +00:00
|
|
|
this.DeleteEvent += new Gtk.DeleteEventHandler(delete_event);
|
2003-03-14 07:31:51 +00:00
|
|
|
string svg_file_name = "sample.svg";
|
2004-08-24 20:26:36 +00:00
|
|
|
Gdk.Pixbuf pixbuf = Rsvg.Pixbuf.FromFile (svg_file_name);
|
2003-03-14 07:31:51 +00:00
|
|
|
|
|
|
|
Gtk.Image image = new Gtk.Image();
|
|
|
|
image.Pixbuf = pixbuf;
|
|
|
|
|
2004-06-18 21:38:57 +00:00
|
|
|
this.Add (image);
|
2003-03-14 07:31:51 +00:00
|
|
|
}
|
|
|
|
|
2004-02-10 20:35:40 +00:00
|
|
|
private void delete_event(object obj, Gtk.DeleteEventArgs args)
|
2003-03-14 07:31:51 +00:00
|
|
|
{
|
2004-06-18 21:38:57 +00:00
|
|
|
Application.Quit();
|
2003-03-14 07:31:51 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|