mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-26 10:25:28 +00:00
a7a0bf8042
* sample/rsvg/Makefile.am: do not reference gnome-sharp and art-sharp * sample/rsvg/svghelloworld.cs: rework with just gtk (no gnome deps) svn path=/trunk/gtk-sharp/; revision=29923
42 lines
1,023 B
C#
42 lines
1,023 B
C#
//
|
|
// samples/rsvg/svghelloworkd.cs
|
|
//
|
|
// Author: Charles Iliya Krempeaux
|
|
//
|
|
using System;
|
|
using Gtk;
|
|
|
|
class SvgHelloWorld
|
|
{
|
|
static void Main (string[] args)
|
|
{
|
|
Application.Init ();
|
|
MyMainWindow app = new MyMainWindow ();
|
|
app.ShowAll ();
|
|
|
|
Application.Run ();
|
|
}
|
|
}
|
|
|
|
class MyMainWindow : Gtk.Window
|
|
{
|
|
public MyMainWindow () : base ("SVG Hello World")
|
|
{
|
|
this.DeleteEvent += new Gtk.DeleteEventHandler(delete_event);
|
|
string svg_file_name = "sample.svg";
|
|
Gdk.Pixbuf pixbuf = Rsvg.Tool.PixbufFromFile (svg_file_name);
|
|
|
|
Gtk.Image image = new Gtk.Image();
|
|
image.Pixbuf = pixbuf;
|
|
|
|
this.Add (image);
|
|
}
|
|
|
|
private void delete_event(object obj, Gtk.DeleteEventArgs args)
|
|
{
|
|
Application.Quit();
|
|
}
|
|
}
|
|
|
|
|