Gtk.EventBox Class
A widget used to catch events for widgets which do not have their own window.

See Also: EventBox Members

Syntax

public class EventBox : Bin

Remarks

The Gtk.EventBox widget is a subclass of Gtk.Bin 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.

C# Example

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();
	}
}
				

Requirements

Namespace: Gtk
Assembly: gtk-sharp (in gtk-sharp.dll)
Assembly Versions: 2.12.0.0