2001-10-07 00:41:52 +00:00
|
|
|
// ButtonApp.cs - Gtk.Button class Test implementation
|
|
|
|
//
|
|
|
|
// Author: Mike Kestner <mkestner@speakeasy.net>
|
|
|
|
//
|
2002-04-09 19:10:31 +00:00
|
|
|
// (c) 2001-2002 Mike Kestner
|
2001-10-07 00:41:52 +00:00
|
|
|
|
|
|
|
namespace GtkSamples {
|
|
|
|
|
|
|
|
using Gtk;
|
2002-02-18 19:26:33 +00:00
|
|
|
using GtkSharp;
|
2001-10-07 00:41:52 +00:00
|
|
|
using System;
|
2002-05-02 23:29:33 +00:00
|
|
|
using System.Drawing;
|
2001-10-07 00:41:52 +00:00
|
|
|
|
|
|
|
public class ButtonApp {
|
|
|
|
|
|
|
|
public static int Main (string[] args)
|
|
|
|
{
|
2002-04-09 19:10:31 +00:00
|
|
|
Application.Init ();
|
2002-05-02 23:29:33 +00:00
|
|
|
Window win = new Window ("Button Tester");
|
|
|
|
win.DefaultSize = new Size (200, 150);
|
2002-07-16 23:14:35 +00:00
|
|
|
win.DeleteEvent += new DeleteEventHandler (Window_Delete);
|
2002-04-09 19:10:31 +00:00
|
|
|
Button btn = new Button ("Click Me");
|
2001-10-07 00:41:52 +00:00
|
|
|
btn.Clicked += new EventHandler (btn_click);
|
2002-06-21 Rachel Hestilow <hestilow@ximian.com>
* generator/ClassBase.cs: New base class for classes and interfaces.
* generator/InterfaceGen.cs: Inherit from ClassBase, generate declarations.
* generator/ObjectGen.cs: Move half of this into ClassBase.
* generator/Method.cs: Turn all applicable Get/Set functions into .NET
accessors. Remove redundant == overload and move into Equals, as
it was confusing "!= null".
* generator/Parameters.cs: Alter signature creation to accept "is_set"
option, add support for variable arguments. Add properties "Count",
"IsVarArgs", "VAType".
* generator/Ctor.cs: Fixup for changes in Parameters (indenting,
signature creation).
* generator/Signal.cs: Support generating declarations.
* generator/SymbolTable: Change GetObjectGen to GetClassGen.
* glib/IWrapper.cs: Move "Handle" declaration to here, so
both classes and interfaces can benefit from it.
* glib/Object.cs: Inherit from IWrapper.cs
* parser/Metadata.pm: Support attribute changes on constructors,
methods, signals, and paramater lists.
* parser/gapi2xml.pl: Parse init funcs for interfaces. Ignore "_"
functions here.
* parser/gapi_pp.pl: Remove boxed_type_register check, as it will
be caught in the init funcs.
* parser/Atk.metadata: Added.
* parser/Gtk.metadata: Add all needed signal/method collision
renames. Rename GtkEditable.Editable accessors to IsEditable,
as .NET does not like accessors with the same name as their
declaring type. Tag TreeStore constructor as varargs.
* samples/ButtonApp.cs: s/EmitAdd/Add.
* samples/Menu.cs: s/EmitAdd/Add, s/Activate/Activated.
svn path=/trunk/gtk-sharp/; revision=5394
2002-06-21 17:15:19 +00:00
|
|
|
win.Add (btn);
|
2002-02-15 11:15:11 +00:00
|
|
|
win.ShowAll ();
|
2001-10-07 00:41:52 +00:00
|
|
|
Application.Run ();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void btn_click (object obj, EventArgs args)
|
|
|
|
{
|
|
|
|
Console.WriteLine ("Button Clicked");
|
|
|
|
}
|
|
|
|
|
2002-07-16 23:14:35 +00:00
|
|
|
static void Window_Delete (object obj, DeleteEventArgs args)
|
2001-10-07 00:41:52 +00:00
|
|
|
{
|
|
|
|
Application.Quit ();
|
2002-07-16 23:14:35 +00:00
|
|
|
args.RetVal = true;
|
2001-10-07 00:41:52 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|