2004-06-18 John Luke <jluke@cfl.rr.com>

* 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
This commit is contained in:
John Luke 2004-06-18 21:38:57 +00:00
parent 11f70f092e
commit a7a0bf8042
3 changed files with 18 additions and 23 deletions

View file

@ -1,3 +1,8 @@
2004-06-18 John Luke <jluke@cfl.rr.com>
* sample/rsvg/Makefile.am: do not reference gnome-sharp and art-sharp
* sample/rsvg/svghelloworld.cs: rework with just gtk (no gnome deps)
2004-06-15 Mike Kestner <mkestner@ximian.com> 2004-06-15 Mike Kestner <mkestner@ximian.com>
* gtk/Gtk.metadata : hide the button_new_from_stock ctor. * gtk/Gtk.metadata : hide the button_new_from_stock ctor.

View file

@ -1,4 +1,4 @@
assemblies = ../../glib/glib-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll ../../glade/glade-sharp.dll ../../art/art-sharp.dll ../../gnome/gnome-sharp.dll ../../rsvg/rsvg-sharp.dll assemblies = ../../glib/glib-sharp.dll ../../pango/pango-sharp.dll ../../atk/atk-sharp.dll ../../gdk/gdk-sharp.dll ../../gtk/gtk-sharp.dll ../../rsvg/rsvg-sharp.dll
references = $(addprefix /r:, $(assemblies)) references = $(addprefix /r:, $(assemblies))
if ENABLE_RSVG if ENABLE_RSVG

View file

@ -3,48 +3,38 @@
// //
// Author: Charles Iliya Krempeaux // Author: Charles Iliya Krempeaux
// //
using System;
using Gtk;
class SvgHelloWorld class SvgHelloWorld
{ {
static void Main (string[] args) static void Main (string[] args)
{ {
Gnome.Program program = Application.Init ();
new Gnome.Program("Hello World", "1.0", Gnome.Modules.UI, args); MyMainWindow app = new MyMainWindow ();
app.ShowAll ();
MyMainWindow app = new MyMainWindow(program); Application.Run ();
app.Show();
program.Run();
} }
} }
class MyMainWindow : Gtk.Window
class MyMainWindow
: Gnome.App
{ {
Gnome.Program program; public MyMainWindow () : base ("SVG Hello World")
public MyMainWindow(Gnome.Program gnome_program)
: base("SVG Hello World", "SVG Hello World")
{ {
this.program = gnome_program;
this.DeleteEvent += new Gtk.DeleteEventHandler(delete_event); this.DeleteEvent += new Gtk.DeleteEventHandler(delete_event);
string svg_file_name = "sample.svg"; string svg_file_name = "sample.svg";
Gdk.Pixbuf pixbuf = Rsvg.Tool.PixbufFromFile (svg_file_name); Gdk.Pixbuf pixbuf = Rsvg.Tool.PixbufFromFile (svg_file_name);
Gtk.Image image = new Gtk.Image(); Gtk.Image image = new Gtk.Image();
image.Pixbuf = pixbuf; image.Pixbuf = pixbuf;
this.Contents = image; this.Add (image);
} }
private void delete_event(object obj, Gtk.DeleteEventArgs args) private void delete_event(object obj, Gtk.DeleteEventArgs args)
{ {
this.program.Quit(); Application.Quit();
} }
} }