mirror of
https://github.com/Ryujinx/GtkSharp.git
synced 2024-12-24 16:05:35 +00:00
gtk-sharp module split
svn path=/trunk/gtk-sharp/; revision=63096
This commit is contained in:
parent
cc3edbb8fb
commit
d430cf6229
|
@ -1,16 +0,0 @@
|
|||
assemblies = ../../glib/glib-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll ../../art/art-sharp.dll ../../rsvg/rsvg-sharp.dll
|
||||
references = $(addprefix /r:, $(assemblies))
|
||||
|
||||
if ENABLE_RSVG
|
||||
TARGETS = svghelloworld.exe
|
||||
else
|
||||
TARGETS =
|
||||
endif
|
||||
CLEANFILES = $(TARGETS)
|
||||
noinst_SCRIPTS = $(TARGETS)
|
||||
EXTRA_DIST = svghelloworld.cs sample.svg
|
||||
|
||||
SOURCES = $(srcdir)/svghelloworld.cs
|
||||
svghelloworld.exe: $(SOURCES) $(assemblies)
|
||||
$(CSC) /out:svghelloworld.exe $(SOURCES) $(references)
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
using System;
|
||||
using Gtk;
|
||||
using Rsvg;
|
||||
|
||||
class RsvgResourceTest : Window
|
||||
{
|
||||
static void Main ()
|
||||
{
|
||||
Application.Init ();
|
||||
new RsvgResourceTest ();
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
RsvgResourceTest () : base ("Rsvg Draw Test")
|
||||
{
|
||||
this.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||
|
||||
Image image = new Image ();
|
||||
image.Pixbuf = Pixbuf.LoadFromResource ("sample.svg");
|
||||
this.Add (image);
|
||||
|
||||
this.ShowAll ();
|
||||
}
|
||||
|
||||
void OnWinDelete (object sender, DeleteEventArgs e)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
using System;
|
||||
using System.IO;
|
||||
using Gtk;
|
||||
using Rsvg;
|
||||
|
||||
class RsvgResourceTest : Window
|
||||
{
|
||||
static void Main ()
|
||||
{
|
||||
Application.Init ();
|
||||
new RsvgResourceTest ();
|
||||
Application.Run ();
|
||||
}
|
||||
|
||||
RsvgResourceTest () : base ("Rsvg Draw Test")
|
||||
{
|
||||
this.DeleteEvent += new DeleteEventHandler (OnWinDelete);
|
||||
|
||||
Image image = new Image ();
|
||||
|
||||
// contrived way to get a stream
|
||||
System.IO.Stream s = System.Reflection.Assembly.GetCallingAssembly ().GetManifestResourceStream ("sample.svg");
|
||||
if (s == null)
|
||||
throw new ArgumentException ("resource must be a valid resource name of 'assembly'.");
|
||||
|
||||
image.Pixbuf = Pixbuf.LoadFromStream (s);
|
||||
this.Add (image);
|
||||
|
||||
this.ShowAll ();
|
||||
}
|
||||
|
||||
void OnWinDelete (object sender, DeleteEventArgs e)
|
||||
{
|
||||
Application.Quit ();
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load diff
Before Width: | Height: | Size: 58 KiB |
|
@ -1,41 +0,0 @@
|
|||
//
|
||||
// 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.Pixbuf.FromFile (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();
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in a new issue