// GTK.Widget.cs - GTK Widget class implementation // // Author: Mike Kestner // // (c) 2001 Mike Kestner namespace Gtk { using System; using System.Collections; using System.Runtime.InteropServices; using GLib; using Gdk; public class Widget : Object { private static readonly string DelEvName = "delete-event"; private Hashtable Signals = new Hashtable (); // Properties // FIXME: Implement Parent, Style, Event, & ExtensionEvents /// /// AppPaintable Property /// /// /// /// FIXME: What's this? /// public bool AppPaintable { get { bool val; GetProperty ("app-paintable", out val); return val; } set { SetProperty ("app-paintable", value); } } /// /// CanDefault Property /// /// /// /// Indicates if the Widget can be the default for focus. /// public bool CanDefault { get { bool val; GetProperty ("can-default", out val); return val; } set { SetProperty ("can-default", value); } } /// /// CanFocus Property /// /// /// /// Indicates if the Widget can obtain the input focus. /// public bool CanFocus { get { bool val; GetProperty ("can-focus", out val); return val; } set { SetProperty ("can-focus", value); } } /// /// CompositeChild Property /// /// /// /// FIXME: What's this? /// public bool CompositeChild { get { bool val; GetProperty ("composite-child", out val); return val; } set { SetProperty ("composite-child", value); } } /// /// HasDefault Property /// /// /// /// Indicates if the Widget is the default for focus. /// public bool HasDefault { get { bool val; GetProperty ("has-default", out val); return val; } set { SetProperty ("has-default", value); } } /// /// HasFocus Property /// /// /// /// Indicates if the Widget has the input focus. /// public bool HasFocus { get { bool val; GetProperty ("has-focus", out val); return val; } set { SetProperty ("has-focus", value); } } /// /// HeightRequest Property /// /// /// /// The desired height in pixels for the widget. /// public int HeightRequest { get { int val; GetProperty ("height-request", out val); return val; } set { SetProperty ("height-request", value); } } /// /// Name Property /// /// /// /// The name of the widget. /// public String Name { get { String val; GetProperty ("name", out val); return val; } set { SetProperty ("name", value); } } /// /// ReceivesDefault Property /// /// /// /// FIXME: What does this do? /// public bool ReceivesDefault { get { bool val; GetProperty ("receives-default", out val); return val; } set { SetProperty ("receives-default", value); } } /// /// Sensitive Property /// /// /// /// Indicates if the Widget is sensitive to input. /// public bool Sensitive { get { bool val; GetProperty ("sensitive", out val); return val; } set { SetProperty ("sensitive", value); } } /// /// Visible Property /// /// /// /// Indicates if the Widget is visible. /// public bool Visible { get { bool val; GetProperty ("visible", out val); return val; } set { SetProperty ("visible", value); } } /// /// WidthRequest Property /// /// /// /// The desired height in pixels for the widget. /// public int WidthRequest { get { int val; GetProperty ("width-request", out val); return val; } set { SetProperty ("width-request", value); } } /// /// DeleteEvent Event /// /// /// /// Signal emitted when a widget is deleted by the /// windowing environment. /// public event EventHandler DeleteEvent { add { if (Events [DelEvName] == null) Signals [DelEvName] = new SimpleEvent ( this, RawObject, DelEvName, value); Events.AddHandler(DelEvName, value); } remove { Events.RemoveHandler(DelEvName, value); if (Events [DelEvName] == null) Signals.Remove (DelEvName); } } /// /// Show Method /// /// /// /// Makes the Widget visible on the display. /// [DllImport("gtk-1.3.dll")] static extern void gtk_widget_show (IntPtr obj); public void Show () { gtk_widget_show (RawObject); } } }