GtkSharp/sample/GladeViewer.cs
Rachel Hestilow c8d090f62f 2002-08-31 Rachel Hestilow <hestilow@ximian.com>
Proper GList, GSList support. Read-only for now.

	* glue/list.c: Added.
	* glue/Makefile.am: Add list.c
	* glue/type.c: Add function gtksharp_is_object.

	* glib/ListBase.cs, List.cs: Added.
	* glib/SList.cs: Inherit from ListBase.
	* glib/Object.cs: Add static method "IsObject".

	* generator/Method.cs: Pass on element_type to constructor
	if specified.
	* generator/SymbolTable.cs: Move GList to manual types.

	* sample/GladeViewer.cs: Remove list hacks.

	* sources/Gnome.metadata: Specify element types for
	CanvasPathDef.Split and IconList.GetSelection. Rename
	CanvasPathDef *to methods to properly capitalized *To.
	* sources/Gtk.metadata: Hide Widget.ListAccelClosures until
	GClosure is handled properly.
	* sources/Pango.metadata: Added.

	* sample/test/TestToolbar.cs: Compile with recent delegate changes.

svn path=/trunk/gtk-sharp/; revision=7166
2002-09-01 04:46:38 +00:00

52 lines
1.3 KiB
C#
Raw Blame History

// GladeViewer.cs - Silly tests for LibGlade in C#
//
// Author: Ricardo Fern<72>ndez Pascual <ric@users.sourceforge.net>
//
// (c) 2002 Ricardo Fern<72>ndez Pascual
namespace GladeSamples {
using System;
using System.Runtime.InteropServices;
using Gtk;
using Gnome;
using Glade;
public class GladeDemo {
public static void Main (string[] args)
{
if (args.Length < 2) {
Console.WriteLine ("Use: mono ./glade-viewer.exe \"fname\" \"root\"");
return;
}
Program viewer = new Program ("GladeViewer", "0.1", Modules.UI, args);
string fname = args [0];
string root = args [1];
Glade.XML gxml = new Glade.XML (fname, root, null);
Widget wid = gxml [root];
wid.Show ();
Console.WriteLine ("The filename: {0}", gxml.Filename);
Console.WriteLine ("A relative filename: {0}", gxml.RelativeFile ("image.png"));
Console.WriteLine ("The name of the root widget: {0}", Glade.XML.GetWidgetName (wid));
Console.WriteLine ("BTW, it's {0} that it was created using from a Glade.XML object",
Glade.XML.GetWidgetTree (wid) != null);
Console.WriteLine ("\nList of created widgets:");
GLib.List l = gxml.GetWidgetPrefix ("");
foreach (Widget w in l) {
Console.WriteLine ("{0} {1}",
w.GetType (),
Glade.XML.GetWidgetName (w));
}
viewer.Run ();
}
}
}