gtk-sharp0.0.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.A widget that creates a signal when clicked on.
The widget is generally used to attach to a function that is called when the button is pressed.
The widget can hold any valid child widget.
That is, it can hold most any other standard . The most commonly used child is the .
using Gtk;
using GtkSharp;
using System;
public class ButtonApp {
public static int Main (string[] args)
{
Application.Init ();
Window win = new Window ("Button Tester");
win.DefaultSize = new Size (200, 150);
win.DeleteEvent += new DeleteEventHandler (Window_Delete);
Button btn = new Button ("Click Me");
btn.Clicked += new EventHandler (btn_click);
win.Add (btn);
win.ShowAll ();
Application.Run ();
return 0;
}
static void btn_click (object obj, EventArgs args)
{
Console.WriteLine ("Button Clicked");
}
static void Window_Delete (object obj, DeleteEventArgs args)
{
Application.Quit ();
args.RetVal = true;
}
}
Gtk.BinAtk.ImplementorGLib.IWrapperGLib.IWrapperSystem.IDisposablePropertySystem.UInt32The for .The for the class.PropertySystem.BooleanWhether the should use a .
Boolean value to select if the
uses a or not.
Gets a value indicating if the uses a .It's possible to create a from , which is recommended for consistency in
apps. They also provide a and a key shortcut.
PropertySystem.BooleanIndicates if a mnemonic is associated with the .
Boolean value to select if the uses
underline or not.
Gets a value indicating if the uses underline
or not.PropertyGtk.ReliefStyleThe for the .
The for
the .
An instance of that
represents the relief style of the .PropertySystem.StringThe text of the in the .
A to be used for
the 's The contained by the .EventSystem.EventHandler
Event launched when the is activated.EventSystem.EventHandler
Event launched when the is clicked.EventSystem.EventHandler
Event launched when the cursor leaves the area.EventSystem.EventHandler
Event launched when the is pressed.EventSystem.EventHandler
Event launched when the is released.EventSystem.EventHandler
Event launched when the cursor enters the area.MethodSystem.UInt32To be addedan object of type To be addedMethodGtk.ButtonCreates a widget with a child containing the given text.
The text you want the to hold.
The newly created widget.MethodGtk.ButtonCreates a new containing the image and text from a stock item.
The name of the stock item
a new
The valid names of Stock items can be found in the class.
MethodSystem.VoidEmits a signal to the given .Emits a signal to the given .MethodSystem.VoidEmits a signal to the given .Emits a signal to the given .MethodSystem.VoidEmits a signal to the given .Emits a signal to the given .MethodSystem.VoidEmits a signal to the given .Emits a signal to the given .MethodSystem.VoidEmits a signal to the given .Emits a signal to the given .MethodSystem.VoidDisposes the resources associated with this object.ConstructorInternal constructor
GLib type for the type.
Creates a new instance of , using the GLib provided type.This is a constructor used by derivative types of
that would have their own GLib type
assigned to it. This is not typically used by C# code.ConstructorDefault parameterless constructor.An instance of .This is the default constructor for the class.ConstructorConstructor that creates a labeled .
A that will be
used to create a for the A containing a
with the specified .Constructor that creates a labeled . The label
shows the string passed as parameter.ConstructorTo be added
an object of type an object of type To be added