From e35de3df95fa09e35660ae263c10a1aa02701571 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Mon, 14 Aug 2006 05:07:35 +0000 Subject: [PATCH] Patch from juancri@juancri.com svn path=/trunk/gtk-sharp/; revision=63700 --- doc/en/Gtk/Widget.xml | 1016 +++-------------------------------------- 1 file changed, 64 insertions(+), 952 deletions(-) diff --git a/doc/en/Gtk/Widget.xml b/doc/en/Gtk/Widget.xml index bae6e12b3..e1c6ea2cd 100644 --- a/doc/en/Gtk/Widget.xml +++ b/doc/en/Gtk/Widget.xml @@ -252,7 +252,7 @@ The advantage of adding to the invalidated region compared to simply drawing immediately is efficiency; using an invalid region ensures that you only have to redraw one time. - + If an immediate redraw is desired, a call to will force an immediate refresh of the drawable. This can be useful in situations where mouse activity requires immediate visible feedback on the widget. @@ -816,8 +816,7 @@ To change the font of a simple Widget: - - + using Pango; ... [Widget] Label label1; @@ -826,8 +825,7 @@ To change the font of a simple Widget: ... label1.ModifyFont(FontDescription.FromString("Courier 16")); ... - - + @@ -2616,7 +2614,43 @@ handle focus grabs. Raised when the user has clicked on the "close" button in the window's frame (the button that is automatically set by the window manager). - If the handler returns False, the widget will be destroyed (and the window closed), but if the handler returns True, nothing will be done. This is a good way to prevent the user from closing your application's window if there should be some cleanups first (like saving the document). + If the handler returns False, the widget will be destroyed (and the window closed), but if the handler returns True, nothing will be done. This is a good way to prevent the user from closing your application's window if there should be some cleanups first (like saving the document). + + + +using System; +using Gtk; + +class TestClose +{ + public static void Main () + { + // Init Gtk# + Application.Init (); + + // Create window + Window win = new Window ("Test Close"); + win.SetDefaultSize (300, 300); + + // Add button + Button button = new Button ("Close Now"); + button.Clicked += delegate { Application.Quit (); }; + win.Add (button); + + // Delete event + win.DeleteEvent += delegate (object o, DeleteEventArgs e) + { + // Cancel closing then the "Close" + // button of the window is pressed + e.RetVal = true; + }; + + // Show window and run + win.ShowAll (); + Application.Run (); + } +} + @@ -3756,624 +3790,54 @@ handle focus grabs. Override this method in a subclass to provide a default handler for the event. -xs - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Void - - - - Default handler for the event. - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Boolean - - - - - - Default handler for the event. - a - a - Override this method in a subclass to provide a default handler for the event. - - - - Method - - System.Void - - - - - - - - - - Installs an accelerator for this in that causes to be emitted if the accelerator is activated. - Widget signal to emit on accelerator activation. - Accel group for this , added to its toplevel. - GDK keyval of the accelerator. - Modifier key combination of the accelerator. - Flag accelerators. - - +xs MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.VoidDefault handler for the event.Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.BooleanDefault handler for the event.a a Override this method in a subclass to provide a default handler for the event.MethodSystem.VoidInstalls an accelerator for this in that causes to be emitted if the accelerator is activated.Widget signal to emit on accelerator activation.Accel group for this , added to its toplevel.GDK keyval of the accelerator.Modifier key combination of the accelerator.Flag accelerators. The needs to be added to the widget's toplevel via , and the signal must be of type G_RUN_ACTION. Accelerators added through this method are not user changeable during runtime. - - + Accelerators added through this method are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use instead. - - - - - - Method - - System.Void - - - - - - - - Installs an accelerator for this in that causes to be emitted if the accelerator is activated. - Widget signal to emit on accelerator activation. - Accel group for this , added to its toplevel. - GDK keyval of the accelerator. - - + MethodSystem.VoidInstalls an accelerator for this in that causes to be emitted if the accelerator is activated.Widget signal to emit on accelerator activation.Accel group for this , added to its toplevel.GDK keyval of the accelerator. The needs to be added to the widget's toplevel via , and the signal must be of type G_RUN_ACTION. Accelerators added through this method are not user changeable during runtime. - - + Accelerators added through this method are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use instead. - - - - - - Property - - Gdk.EventMask - - - - Obtains or sets the event mask for the (a bitfield containing flags from ). - a - - + PropertyGdk.EventMaskObtains or sets the event mask for the (a bitfield containing flags from ).a The event mask determines which events a will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a 's fuctionalit, so be careful. - - + This property must be called while a is unrealized. Consider for widgets that are already realized, or if you want to preserve the existing event mask. - - + This property can't be used with widgets; to get events on those events, place them inside a and receive events on the event box. - - + These are the events that the will receive. - - - - - - GLib.Property(Name="events") - - - - - Method - - System.Void - - - - - - Default handler for the event. - a - Override this method in a subclass to provide a default handler for the event. - - - - Property - - Gdk.Window - - - - Obtains or sets the underlying Gdk.Window used to display the contents of the . - a - - - - - Property - - System.Int32 - - - - Obtains or sets the flags for this . - a - - + GLib.Property(Name="events")MethodSystem.VoidDefault handler for the event.a Override this method in a subclass to provide a default handler for the event.PropertyGdk.WindowObtains or sets the underlying Gdk.Window used to display the contents of the .a PropertySystem.Int32Obtains or sets the flags for this .a This property should only be used when writing custom widgets in C#. The property is a preferred more strongly typed member. This member is obsolete in Gtk# 2.0. - - + See for possible values. - - - - - - System.Obsolete(Message=null, IsError=False) - - - - - Method - - Gtk.Requisition - - - - Obtains the preferred size of a . - a - - + System.Obsolete(Message=null, IsError=False)MethodGtk.RequisitionObtains the preferred size of a .a The container uses this information to arrange its child widgets and decide what size allocations to give them with . - - + You can also call this method from an application, with some caveats. Most notably, getting a size request requieres the to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind. - - + Also remember that the size request is not necessarily the size a will actually be allocated. - - - - - - Constructor - - - - Protected constructor. - - - - - Property - - System.Int32 - - - - The width of the focus line in a . - a - - + ConstructorProtected constructor.PropertySystem.Int32The width of the focus line in a .a Subclasses of use this style property to correctly layout their children. - - - - - - Property - - Gdk.Rectangle - - - - Gets or Sets the widget's allocation. - a representing the size of the widget's allocation. + PropertyGdk.RectangleGets or Sets the widget's allocation.a representing the size of the widget's allocation. When the top-level widget has determined how much space its child would like to have, the second phase of the size negotiation, size allocation, begins. Depending on its configuration (see ), the top-level widget may be able to expand in order to satisfy the size request or it may have to ignore the size request and keep its fixed size. It then tells its child widget how much space it gets by calling . The child widget divides the space among its children and tells each child how much space it got, and so on. Under normal circumstances, a will always give its child the amount of space the child requested. A child's size allocation is represented by a . This struct contains not only a width and height, but also a position (i.e. X and Y coordinates), so that containers can tell their children not only how much space they have gotten, but also where they are positioned inside the space available to the container. Widgets are required to honor the size allocation they receive; a size request is only a request, and widgets must be able to cope with any size. - - None. - - - - Property - - Gtk.Requisition - - - - Gets or Sets the widget's requisition - a representing the widget's requisition - - - - - - - Property - - System.Boolean - - - - Check to see if the widget is Mapped - true if the widget is Mapped, false otherwise. - None. - - - - Property - - System.Boolean - - - - Checks to see if the widget is Realized - returns true if the widget is Realized - None. - - - - Property - - System.Boolean - - - - Convenience property to check Flags for WidgetFlags.NoWindow - True if the NoWindow flag is set. - None. - - - - Property - - System.Boolean - - - - Convenience property to check Flags for WidgetFlags.Toplevel - True if the Toplevel flag is set. - None - - - - Property - - System.Boolean - - - - Convenience property to check Flags for WidgetFlags.HasGrab - True if the HasGrab flag is set. - None. - - - - Property - - System.Boolean - - - - Convenience property to check Flags for WidgetFlags.CompositeChild - True if the CompositeChild flag is set - None - - - - Property - - System.Boolean - - - - Convenience property to check Flags for WidgetFlags.AppPaintable - True if the AppPaintable flag is set - None - - - - Property - - System.Boolean - - - - Convenience property to check Flags for WidetFlags.DoubleBuffered - True if the DoubleBuffered flag is set. - None - - - - Property - - System.Boolean - - - - Convenience property to check if the widget is Visible and Realized. - True if the widget is able to be drawn on - None - - - - Method - - System.Void - - - - - - Convenience method to set a flag. - a to set - None. - - - - Method - - System.Void - - - - - - Convenince method to clear a flag - a to set - None - - - - Method - - System.Void - - - - - - - Virtual method to support scrollable widgets. - a horizontal plane - a vertical plane - Override this method in a subclass to support scrolling of the widget within a viewport smaller than the widget's size. - - - - Property - - Gtk.Requisition - - - - Obtains the widget's requisition. - a - - +None.PropertyGtk.RequisitionGets or Sets the widget's requisitiona representing the widget's requisitionPropertySystem.BooleanCheck to see if the widget is Mappedtrue if the widget is Mapped, false otherwise.None.PropertySystem.BooleanChecks to see if the widget is Realizedreturns true if the widget is RealizedNone.PropertySystem.BooleanConvenience property to check Flags for WidgetFlags.NoWindowTrue if the NoWindow flag is set.None.PropertySystem.BooleanConvenience property to check Flags for WidgetFlags.ToplevelTrue if the Toplevel flag is set.NonePropertySystem.BooleanConvenience property to check Flags for WidgetFlags.HasGrabTrue if the HasGrab flag is set.None.PropertySystem.BooleanConvenience property to check Flags for WidgetFlags.CompositeChildTrue if the CompositeChild flag is setNonePropertySystem.BooleanConvenience property to check Flags for WidgetFlags.AppPaintableTrue if the AppPaintable flag is setNonePropertySystem.BooleanConvenience property to check Flags for WidetFlags.DoubleBufferedTrue if the DoubleBuffered flag is set.NonePropertySystem.BooleanConvenience property to check if the widget is Visible and Realized.True if the widget is able to be drawn onNoneMethodSystem.VoidConvenience method to set a flag.a to setNone.MethodSystem.VoidConvenince method to clear a flaga to setNoneMethodSystem.VoidVirtual method to support scrollable widgets.a horizontal plane a vertical plane Override this method in a subclass to support scrolling of the widget within a viewport smaller than the widget's size.PropertyGtk.RequisitionObtains the widget's requisition.a Obtains requisition, unless someone has forced a particular geometry, in which case it returns that geometry instead of the widget's requisition. This method differs from in that it retrieves the last size request value, while the method recomputes the size request and fills in the requisition, and then returns the recomputed value. - - - - - - Property - - System.Boolean - - - - + PropertySystem.Boolean This property determines whether the widget will be affected by and . - - a , true if the widget should be affected - - - - - - GLib.Property(Name="no-show-all") - - - - - Event - - Gtk.AccelCanActivateHandler - - - - + a , true if the widget should be affectedGLib.Property(Name="no-show-all")EventGtk.AccelCanActivateHandler This signal is present to allow applications and derived widgets to override the default Gtk.Widget handling for determining whether an accelerator can be activated. - - See for more details. - - - - - GLib.Signal(CName="can_activate_accel") - - - - - Method - - System.Boolean - - - - - - + See for more details.GLib.Signal(CName="can_activate_accel")MethodSystem.Boolean Method raised when the event happens; override this for additional functionality. - - a , a signal ID - a , true if the accelerator can be activated. - - - - - - - Method - - System.Void - - - - - - Deprecated. - a - + a , a signal IDa , true if the accelerator can be activated.MethodSystem.VoidDeprecated.a In GTK+ 1.2, this function would immediately render the region of a widget, by invoking the virtual draw method of a widget. In GTK+ 2.0, this method simply invalidates the specified region of the @@ -4381,366 +3845,14 @@ Widgets are required to honor the size allocation they receive; a size request i Usually you don't want to update the region immediately for performance reasons, so in general is a better choice if you want to draw a region of a widget. - - - - - - Method - - System.Void - - - - - - - - - Deprecated equivalent of - a - a - a - a - - - - - - Method - - System.Void - - - - - - Adds a widget to the list of mnemonic labels for this widget. - a - (See ). Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well, by using a connection to the Destroy signal or a weak notifier. - - - - - Method - - System.Void - - - - - - - Deprecated way to set the position of a widget. - a - a - The funny "u" in the name comes from the "user position" hint specified by the X Window System, and exists for legacy reasons. This function does not work if a widget is inside a container; it is only really useful on . - - - - - Method - - System.Void - - - - Deprecated: Use instead. - - - - - - Method - - System.Void - - - - - - - Sets the minimum size of a widget - a - a - - is deprecated and should not be used in newly-written code. - - - - - Method - - System.Void - - - - This function works like , except that the widget is not invalidated. - - - - - - Method - - Gtk.Widget[] - - - - Returns a list of the widgets, normally Labels, for which this widget is a the target of a mnemonic - a - - - - - - Method - - System.Boolean - - - - - - + MethodSystem.VoidDeprecated equivalent of a a a a MethodSystem.VoidAdds a widget to the list of mnemonic labels for this widget.a (See ). Note the list of mnemonic labels for the widget is cleared when the widget is destroyed, so the caller must make sure to update its internal state at this point as well, by using a connection to the Destroy signal or a weak notifier.MethodSystem.VoidDeprecated way to set the position of a widget.a a The funny "u" in the name comes from the "user position" hint specified by the X Window System, and exists for legacy reasons. This function does not work if a widget is inside a container; it is only really useful on .MethodSystem.VoidDeprecated: Use instead.MethodSystem.VoidSets the minimum size of a widgeta a is deprecated and should not be used in newly-written code.MethodSystem.VoidThis function works like , except that the widget is not invalidated.MethodGtk.Widget[]Returns a list of the widgets, normally Labels, for which this widget is a the target of a mnemonica MethodSystem.Boolean Determines whether an accelerator that activates the signal identified by can currently be activated. - - a , a signal ID (XXX: API: should this really work this way?) - a , true if the accelerator can be activated. - + a , a signal ID (XXX: API: should this really work this way?)a , true if the accelerator can be activated. This is done by emitting the signal on the widget; if the signal isn't overridden by a handler or in a derived widget, then the default check is that the widget must be sensitive, and the widget and all its ancestors mapped. - - - - - - Method - - System.Void - - - - - - Removes a widget from the list of mnemonic labels for this widget. - a - The widget must have previously been added to the list with . - - - - - Property - - Gtk.WidgetFlags - - - - Contains Widget specific flags values. - a - - - - - - Event - - Gtk.WidgetEventAfterHandler - - - - Emits the WidgetEventAfter. - - - - - - GLib.Signal(CName="event-after") - - - - - Method - - System.Void - - - - - - Default handler for the event. - a - Override this method in a subclass to provide a default handler for the event. - - - - - Method - - System.Void - - - - - - The state to be reset. - Resets the base color to the default color. - To set a specific color, use the overload of this method. - - - - Method - - System.Void - - - - - - The state to be reset. - Resets the background color to the default color. - To set a specific color, use the overload of this method. - - - - Method - - System.Void - - - - - - The state to be reset. - Resets the foreground color to the default color. - To set a specific color, use the overload of this method. - - - - Method - - System.Void - - - - - - The state to be reset. - Resets the text color to the default color. - To set a specific color, use the overload of this method. - - - - Event - - - GLib.Signal(CName="grab_broken_event") - - - - Gtk.GrabBrokenEventHandler - - - Raised when an existing grab is broken by another. - - - - - - Method - - System.Boolean - - - - - - To be added. - Default handler for the event. - To be added. - Override this method in a subclass to provide a default handler for the event. - - - - - - Event - - - GLib.Signal(CName="composited_changed") - - - - System.EventHandler - - - Raised with the composited status changes. - - - - - - - Method - - System.Void - - - - Default handler for event. - - - - - - - Method - - System.Void - - - - - - - - mask to combine. - x offset of . - y offset of . - Sets an input shape mask for the widget. - Allows widgets to react to non-rectangular regions for mouse events. - - - - - - Property - - System.Boolean - - - Indicates if a widget can rely on its alpha channel being drawn correctly. - if , alpha compositing is available. - Depends on window manager feature availability on X. - - - - - - Property - - Gtk.Action - - - The action the widget proxies. - a , or if no proxy relationship exists. - See for more details. - - - - - + MethodSystem.VoidRemoves a widget from the list of mnemonic labels for this widget.a The widget must have previously been added to the list with .PropertyGtk.WidgetFlagsContains Widget specific flags values.a EventGtk.WidgetEventAfterHandlerEmits the WidgetEventAfter.GLib.Signal(CName="event-after")MethodSystem.VoidDefault handler for the event.a Override this method in a subclass to provide a default handler for the event.MethodSystem.VoidThe state to be reset.Resets the base color to the default color.To set a specific color, use the overload of this method.MethodSystem.VoidThe state to be reset.Resets the background color to the default color.To set a specific color, use the overload of this method.MethodSystem.VoidThe state to be reset.Resets the foreground color to the default color.To set a specific color, use the overload of this method.MethodSystem.VoidThe state to be reset.Resets the text color to the default color.To set a specific color, use the overload of this method.EventGLib.Signal(CName="grab_broken_event")Gtk.GrabBrokenEventHandlerRaised when an existing grab is broken by another.MethodSystem.BooleanTo be added.Default handler for the event.To be added.Override this method in a subclass to provide a default handler for the event.EventGLib.Signal(CName="composited_changed")System.EventHandlerRaised with the composited status changes.MethodSystem.VoidDefault handler for event.MethodSystem.Voidmask to combine.x offset of .y offset of .Sets an input shape mask for the widget.Allows widgets to react to non-rectangular regions for mouse events.PropertySystem.BooleanIndicates if a widget can rely on its alpha channel being drawn correctly.if , alpha compositing is available.Depends on window manager feature availability on X.PropertyGtk.ActionThe action the widget proxies.a , or if no proxy relationship exists.See for more details. + \ No newline at end of file