diff --git a/doc/ChangeLog b/doc/ChangeLog index d41daa355..029e8d0da 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,8 @@ +2004-07-02 Mike Kestner + + * en/GLib/*.xml : docs for Boxed, ConnectBeforeAttribute, and + DefaultSignalHandlerAttribute. + 2004-07-02 Peter Johanson * en/Art/*.xml : docs for some Art API. diff --git a/doc/en/GLib/Boxed.xml b/doc/en/GLib/Boxed.xml index ebf2be3bf..83dc14313 100644 --- a/doc/en/GLib/Boxed.xml +++ b/doc/en/GLib/Boxed.xml @@ -11,8 +11,7 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. An abstract base class to derive structures and marshal them. - - + This class is not used by the generator as of 1.0 and will be removed in future versions. System.Object @@ -57,9 +56,9 @@ - To be added + Do not use. a - To be added + Do not use. @@ -70,9 +69,9 @@ - To be added + Do not use. a - To be added + Do not use. diff --git a/doc/en/GLib/ConnectBeforeAttribute.xml b/doc/en/GLib/ConnectBeforeAttribute.xml index d26615274..3c58aeaff 100644 --- a/doc/en/GLib/ConnectBeforeAttribute.xml +++ b/doc/en/GLib/ConnectBeforeAttribute.xml @@ -9,8 +9,32 @@ Gtk# is thread aware, but not thread safe; See the Gtk# Thread Programming for details. - To be added - To be added + Identifies a delegate to run before the default signal handler. + + + Use this attribute to attach an event handler to an object and cause it to be invoked before the default signal handler of the object. While this mechanism can be used to pierce the object's encapsulation and change the behavior of the object without subclassing it, the cleaner approach would be to subclass the object and override the virtual method for the default signal handler. + + + In the following example, the ButtonClicked method will be invoked before the virtual method is executed. + + + +public class Example { + public static int Main (string[] args) + { + Gtk.Button btn = new Gtk.Button ("Click me"); + btn.Clicked = new EventHandler (ButtonClicked); + } + + [GLib.ConnectBefore] + private void ButtonClicked (object o, EventArgs args) + { + Console.WriteLine ("Got Clicked"); + } +} + + + System.Attribute @@ -24,9 +48,10 @@ - To be added + Public Constructor. a - To be added + + diff --git a/doc/en/GLib/DefaultSignalHandlerAttribute.xml b/doc/en/GLib/DefaultSignalHandlerAttribute.xml index baade40aa..cfd050fa2 100644 --- a/doc/en/GLib/DefaultSignalHandlerAttribute.xml +++ b/doc/en/GLib/DefaultSignalHandlerAttribute.xml @@ -10,8 +10,37 @@ - To be added - To be added + Identifies a virtual class method on a GLib.Object subclass. + + +When a virtual method tagged with this attribute is overridden in a subclass, the method is automatically hooked into the native object's vtable. For the most part, this is an internal implementation detail, but it can be used by binding code to manually identify GObject virtual methods that can be overridden by subclasses. + + +The following code identifies the ForAll method as an overridable native method on the class. When a managed subclass of Container overrides the ForAll method, at type registration time, the OverrideForall method is invoked to connect up a delegate to the native GtkContainerClass::forall vtable slot. + + + +static void Forall_cb (IntPtr container, bool include_internals, IntPtr cb, IntPtr data) +{ + Container obj = GLib.Object.GetObject (container, false) as Container; + CallbackInvoker invoker = new CallbackInvoker (cb, data); + obj.ForAll (include_internals, invoker); +} + +static void OverrideForall (GLib.GType gtype) +{ + if (ForallCallback == null) + ForallCallback = new ForallDelegate (Forall_cb); + gtksharp_container_override_forall (gtype, ForallCallback); +} + +[GLib.DefaultSignalHandler (Type=typeof(Gtk.Container), ConnectionMethod="OverrideForall")] +protected virtual void ForAll (bool include_internals, CallbackInvoker invoker) +{ + gtksharp_container_base_forall (Handle, include_internals, invoker.Callback, invoker.Data); +} + + System.Attribute @@ -25,9 +54,9 @@ - To be added + Public Constructor. a - To be added + @@ -38,9 +67,9 @@ - To be added - a - To be added + The method to invoke to hook into the native object's vtable. + a representing the method name to invoke. + This method is invoked during type registration to hook up a callback delegate into the native object's vtable for virtual methods. @@ -51,9 +80,9 @@ - To be added + The Type of the object which exposes the virtual method. a - To be added + The type registration code reflects on this type for the to invoke.