Add GtkScaleButton documentation
[cl-gtk2.git] / doc / gtk.widgets.texi
index f36d754..f5825df 100644 (file)
@@ -439,28 +439,82 @@ Superclass: @ref{bin} @ref{atk-implementor-iface} @ref{activatable} @ref{buildab
 
 Subclasses: @ref{scale-button} @ref{link-button} @ref{font-button} @ref{color-button} @ref{toggle-button}
 
+The @ref{button} widget is generally used to attach a function to that is called when the button is pressed. The various signals and how to use them are outlined below.
+
+The @ref{button} widget can hold any valid child widget. That is it can hold most any other standard @ref{widget}. The most commonly used child is the @ref{label}.
+
 Slots:
 @itemize
 @item @anchor{slot.button.focus-on-click}focus-on-click. Type: @code{boolean}. Accessor: @anchor{fn.button-focus-on-click}@code{button-focus-on-click}.
+
+Whether the button grabs focus when it is clicked with the mouse.
+
+Default value: True
 @item @anchor{slot.button.image}image. Type: @ref{widget}. Accessor: @anchor{fn.button-image}@code{button-image}.
+
+Child widget to appear next to the button text.
 @item @anchor{slot.button.image-position}image-position. Type: @ref{position-type}. Accessor: @anchor{fn.button-image-position}@code{button-image-position}.
+
+The position of the image relative to the text inside the button.
+
+Default value: @EnumVRef{position-type,left}
 @item @anchor{slot.button.label}label. Type: @code{string}. Accessor: @anchor{fn.button-label}@code{button-label}.
+
+Text of the label widget inside the button, if the button contains a label widget.
+
+Default value: NIL
 @item @anchor{slot.button.relief}relief. Type: @ref{relief-style}. Accessor: @anchor{fn.button-relief}@code{button-relief}.
+
+The border relief style.
+
+Default value: @EnumVRef{relief-style,normal}
 @item @anchor{slot.button.use-stock}use-stock. Type: @code{boolean}. Accessor: @anchor{fn.button-use-stock}@code{button-use-stock}.
+
+If set, the label is used to pick a stock item instead of being displayed.
+
+Default value: False
 @item @anchor{slot.button.use-underline}use-underline. Type: @code{boolean}. Accessor: @anchor{fn.button-use-underline}@code{button-use-underline}.
+
+If set, an underline in the text indicates the next character should be used for the mnemonic accelerator key.
+
+Default value: False
 @item @anchor{slot.button.xalign}xalign. Type: @code{single-float}. Accessor: @anchor{fn.button-xalign}@code{button-xalign}.
+
+If the child of the button is a @ref{misc} or @ref{alignment}, this property can be used to control it's horizontal alignment. 0.0 is left aligned, 1.0 is right aligned.
+
+Allowed values: [0,1]
+
+Default value: 0.5
 @item @anchor{slot.button.yalign}yalign. Type: @code{single-float}. Accessor: @anchor{fn.button-yalign}@code{button-yalign}.
+
+If the child of the button is a @ref{misc} or @ref{alignment}, this property can be used to control it's vertical alignment. 0.0 is left aligned, 1.0 is right aligned.
+
+Allowed values: [0,1]
+
+Default value: 0.5
 @end itemize
 
 
 Signals:
 @itemize
 @item @anchor{signal.button.activate}"activate". Signature: (instance @ref{button}) @result{} void. Options: run-first, action.
+
+This signal is an action signal and emitting it causes the button to animate press then release. Applications should never connect to this signal, but use the @SignalRef{button,clicked} signal.
 @item @anchor{signal.button.clicked}"clicked". Signature: (instance @ref{button}) @result{} void. Options: run-first, action.
+
+Emitted when the button has been activated (pressed and released).
 @item @anchor{signal.button.enter}"enter". Signature: (instance @ref{button}) @result{} void. Options: run-first.
+
+Emitted when the pointer enters the button.
 @item @anchor{signal.button.leave}"leave". Signature: (instance @ref{button}) @result{} void. Options: run-first.
+
+Emitted when the pointer leaves the button.
 @item @anchor{signal.button.pressed}"pressed". Signature: (instance @ref{button}) @result{} void. Options: run-first.
+
+Emitted when the button is pressed.
 @item @anchor{signal.button.released}"released". Signature: (instance @ref{button}) @result{} void. Options: run-first.
+
+Emitted when the button is released.
 @end itemize
 
 
@@ -550,6 +604,11 @@ Superclass: @ref{toggle-button} @ref{atk-implementor-iface} @ref{activatable} @r
 
 Subclasses: @ref{radio-button}
 
+
+A @ref{check-button} places a discrete @ref{toggle-button} next to a widget, (usually a @ref{label}). See the @ref{toggle-button} for more information about toggle/check buttons.
+
+The important signal @SignalRef{toggle-button,toggled} is also inherited from @ref{toggle-button}.
+
 Slots:
 @itemize
 @end itemize
@@ -2391,10 +2450,22 @@ Signals:
 @Class link-button
 Superclass: @ref{button} @ref{atk-implementor-iface} @ref{activatable} @ref{buildable}
 
+A @ref{link-button} is a @ref{button} with a hyperlink, similar to the one used by web browsers, which triggers an action when clicked. It is useful to show quick links to resources.
+
+@ref{link-button} offers a global hook, which is called when the used clicks on it: see @ref{link-button-global-uri-hook}.
+
 Slots:
 @itemize
 @item @anchor{slot.link-button.uri}uri. Type: @code{string}. Accessor: @anchor{fn.link-button-uri}@code{link-button-uri}.
+
+The URI bound to this button.
+
+Default value: NIL
 @item @anchor{slot.link-button.visited}visited. Type: @code{boolean}. Accessor: @anchor{fn.link-button-visited}@code{link-button-visited}.
+
+The 'visited' state of this button. A visited link is drawn in a different color.
+
+Default value: False
 @end itemize
 
 
@@ -2402,8 +2473,16 @@ Signals:
 @itemize
 @end itemize
 
+@RFunction link-button-global-uri-hook
+@lisp
+(setf (link-button-gloval-uri-hook) function)
+@end lisp
+
+Sets function as the function that should be invoked every time a user clicks a @ref{link-button}. This function is called before every callback registered for the @SignalRef{button,clicked} signal.
 
+If @var{function} is NIL, GTK+ defaults to calling gtk_show_uri() (default function that opens the default application for a URI).
 
+@var{function} is a function of two arguments: a @ref{link-button} and a @code{string}. First argument is the button that was clicked and the second is the URI of the button.
 
 @node menu
 @section menu
@@ -2848,15 +2927,25 @@ Indicates that some progress is made, but you don't know how much. Causes the pr
 @Class radio-button
 Superclass: @ref{check-button} @ref{atk-implementor-iface} @ref{activatable} @ref{buildable}
 
+A single radio button performs the same basic function as a @ref{check-button}, as its position in the object hierarchy reflects. It is only when multiple radio buttons are grouped together that they become a different user interface component in their own right.
+
+Every radio button is a member of some group of radio buttons. When one is selected, all other radio buttons in the same group are deselected. A @ref{radio-button} is one way of giving the user a choice from many options.
+
+To group radio buttons into one group, set @SlotRef{radio-button,group} to one of the radio buttons of the group.
+
 Slots:
 @itemize
 @item @anchor{slot.radio-button.group}group. Type: @ref{radio-button}. Accessor: @anchor{fn.radio-button-group}@code{radio-button-group}. Write-only.
+
+A button of the radio button group that this radio button belongs to
 @end itemize
 
 
 Signals:
 @itemize
 @item @anchor{signal.radio-button.group-changed}"group-changed". Signature: (instance @ref{radio-button}) @result{} void. Options: run-first.
+
+Emitted when the group of radio buttons that a radio button belongs to changes. This is emitted when a radio button switches from being alone to being part of a group of 2 or more buttons, or vice-versa, and when a button is moved from one group of 2 or more buttons to a different one, but not when the composition of the group that a button belongs to changes.
 @end itemize
 
 
@@ -3036,20 +3125,48 @@ Superclass: @ref{button} @ref{atk-implementor-iface} @ref{activatable} @ref{buil
 
 Subclasses: @ref{volume-button}
 
+@ref{scale-button} provides a button which pops up a scale widget. This kind of widget is commonly used for volume controls in multimedia applications, and GTK+ provides a @ref{volume-button} subclass that is tailored for this use case.
+
 Slots:
 @itemize
 @item @anchor{slot.scale-button.adjustment}adjustment. Type: @ref{adjustment}. Accessor: @anchor{fn.scale-button-adjustment}@code{scale-button-adjustment}.
-@item @anchor{slot.scale-button.icons}icons. Type: @code{GStrv}. Accessor: @anchor{fn.scale-button-icons}@code{scale-button-icons}.
+
+The @ref{adjustment} that contains the current value of this scale button object.
+@item @anchor{slot.scale-button.icons}icons. Type: list of @code{string}. Accessor: @anchor{fn.scale-button-icons}@code{scale-button-icons}.
+
+The names of the icons to be used by the scale button. The first item in the list will be used in the button when the current value is the lowest value, the second item for the highest value. All the subsequent icons will be used for all the other values, spread evenly over the range of values.
+
+If there's only one icon name in the icons array, it will be used for all the values. If only two icon names are in the icons array, the first one will be used for the bottom 50% of the scale, and the second one for the top 50%.
+
+It is recommended to use at least 3 icons so that the @ref{scale-button} reflects the current value of the scale better for the users.
 @item @anchor{slot.scale-button.size}size. Type: @ref{icon-size}. Accessor: @anchor{fn.scale-button-size}@code{scale-button-size}.
+
+The icon size.
+
+Default value: @EnumVRef{icon-size,small-toolbar}
 @item @anchor{slot.scale-button.value}value. Type: @code{double-float}. Accessor: @anchor{fn.scale-button-value}@code{scale-button-value}.
+
+The value of the scale.
+
+Default value: 0
 @end itemize
 
 
 Signals:
 @itemize
 @item @anchor{signal.scale-button.popdown}"popdown". Signature: (instance @ref{scale-button}) @result{} void. Options: run-last, action.
+
+This signal is a keybinding signal which gets emitted to popdown the scale widget.
+
+The default binding for this signal is Escape.
 @item @anchor{signal.scale-button.popup}"popup". Signature: (instance @ref{scale-button}) @result{} void. Options: run-last, action.
+
+This signal is a keybinding signal which gets emitted to popup the scale widget.
+
+The default bindings for this signal are Space, Enter and Return.
 @item @anchor{signal.scale-button.value-changed}"value-changed". Signature: (instance @ref{scale-button}), (arg-1 @code{double-float}) @result{} void. Options: run-last.
+
+This signal is emitted when the value field has changed.
 @end itemize
 
 
@@ -3403,17 +3520,35 @@ Superclass: @ref{button} @ref{atk-implementor-iface} @ref{activatable} @ref{buil
 
 Subclasses: @ref{check-button}
 
+A @ref{toggle-button} is a @ref{button} which will remain 'pressed-in' when clicked. Clicking again will cause the toggle button to return to its normal state.
+
+The state of a @ref{toggle-button} is stored in @SlotRef{toggle-button,active} and @SlotRef{toggle-button,inconsistent}.
+
 Slots:
 @itemize
 @item @anchor{slot.toggle-button.active}active. Type: @code{boolean}. Accessor: @anchor{fn.toggle-button-active}@code{toggle-button-active}.
+
+If the toggle button should be pressed in or not.
+
+Default value: False
 @item @anchor{slot.toggle-button.draw-indicator}draw-indicator. Type: @code{boolean}. Accessor: @anchor{fn.toggle-button-draw-indicator}@code{toggle-button-draw-indicator}.
+
+If the toggle part of the button is displayed.
+
+Default value: False
 @item @anchor{slot.toggle-button.inconsistent}inconsistent. Type: @code{boolean}. Accessor: @anchor{fn.toggle-button-inconsistent}@code{toggle-button-inconsistent}.
+
+If the toggle button is in an "in between" state.
+
+Default value: False
 @end itemize
 
 
 Signals:
 @itemize
 @item @anchor{signal.toggle-button.toggled}"toggled". Signature: (instance @ref{toggle-button}) @result{} void. Options: run-first.
+
+Should be connected if you wish to perform an action whenever the @ref{toggle-button}'s state is changed.
 @end itemize