gtk-sharp2.6.0.0Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details.A widget used to catch events for widgets which do not have their own window.The widget is a subclass of which also has its own window. It is useful since it allows you to catch events for widgets which do not have their own window.
using Gtk;
using Gdk;
using System;
public class eventbox
{
static void delete_event (object obj, DeleteEventArgs args)
{
Application.Quit();
}
static void exitbutton_event (object obj, ButtonPressEventArgs args)
{
Application.Quit();
}
public static void Main (string[] args)
{
Gtk.Window window;
EventBox eventbox;
Label label;
Application.Init();
window = new Gtk.Window ("Eventbox");
window.DeleteEvent += new DeleteEventHandler (delete_event);
window.BorderWidth = 10;
eventbox = new EventBox ();
window.Add (eventbox);
eventbox.Show();
label = new Label ("Click here to quit");
eventbox.Add(label);
label.Show();
label.SetSizeRequest(110, 20);
eventbox.ButtonPressEvent += new ButtonPressEventHandler (exitbutton_event);
eventbox.Realize();
window.Show();
Application.Run();
}
}
Gtk.BinConstructorInternal constructor
Pointer to the C object.
This is an internal constructor, and should not be used by user code.ConstructorCreates a new .Creates a new .
EventBox eb = new EventBox();PropertyGLib.GTypeGType Property.a Returns the native value for .ConstructorProtected Constructor.
a Chain to this constructor if you have manually registered a native value for your subclass.System.Obsolete(Message=null, IsError=False)PropertySystem.BooleanWhether the event-trapping window of the eventbox is above the window of the child widget as opposed to below it.a GLib.Property(Name="above-child")PropertySystem.BooleanWhether the event box is visible, as opposed to invisible and only used to trap events.a GLib.Property(Name="visible-window")