Add GtkScaleButton documentation
[cl-gtk2.git] / doc / gtk.widgets.texi
index 33eb6a8..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
 
 
@@ -3208,20 +3325,85 @@ Signals:
 @Class statusbar
 Superclass: @ref{h-box} @ref{atk-implementor-iface} @ref{buildable} @ref{orientable}
 
+A @ref{statusbar} is usually placed along the bottom of an application's main @ref{gtk-window}. It may provide a regular commentary of the application's status (as is usually the case in a web browser, for example), or may be used to simply output a message when the status changes, (when an upload is complete in an FTP client, for example). It may also have a resize grip (a triangular area in the lower right corner) which can be clicked on to resize the window containing the statusbar.
+
+Status bars in GTK+ maintain a stack of messages. The message at the top of the each bar's stack is the one that will currently be displayed.
+
+Any messages added to a statusbar's stack must specify a context id that is used to uniquely identify the source of a message. Context ids may be specified by context descriptions (as string) or by numeric identifiers obtained by @ref{statusbar-context-id}. Note that messages are stored in a stack, and when choosing which message to display, the stack structure is adhered to, regardless of the context description of a message.
+
+One could say that a statusbar maintains one stack of messages for display purposes, but allows multiple message producers to maintain sub-stacks of the messages they produced (via context descriptions).
+
+Messages are added to the bar's stack with @ref{statusbar-push}.
+
+The message at the top of the stack can be removed using @ref{statusbar-pop}. A message can be removed from anywhere in the stack if its @var{message-id} was recorded at the time it was added. This is done using @ref{statusbar-remove}.
+
 Slots:
 @itemize
 @item @anchor{slot.statusbar.has-resize-grip}has-resize-grip. Type: @code{boolean}. Accessor: @anchor{fn.statusbar-has-resize-grip}@code{statusbar-has-resize-grip}.
+
+Whether the statusbar has a grip for resizing the toplevel window.
+
+Default value: True
 @end itemize
 
 
 Signals:
 @itemize
-@item @anchor{signal.statusbar.text-popped}"text-popped". Signature: (instance @ref{statusbar}), (arg-1 @code{integer}), (arg-2 @code{string}) @result{} void. Options: run-last.
-@item @anchor{signal.statusbar.text-pushed}"text-pushed". Signature: (instance @ref{statusbar}), (arg-1 @code{integer}), (arg-2 @code{string}) @result{} void. Options: run-last.
+@item @anchor{signal.statusbar.text-popped}"text-popped". Signature: (instance @ref{statusbar}), (context-id @code{integer}), (text @code{string}) @result{} void. Options: run-last.
+
+Is emitted whenever a new message is popped off a statusbar's stack.
+
+@var{context-id} is a numeric identifier of a context.
+@item @anchor{signal.statusbar.text-pushed}"text-pushed". Signature: (instance @ref{statusbar}), (context-id @code{integer}), (text @code{string}) @result{} void. Options: run-last.
+
+Is emitted whenever a new message gets pushed onto a statusbar's stack.
+
+@var{context-id} is a numeric identifier of a context.
 @end itemize
 
+@RMethod statusbar-context-id
+@lisp
+(statusbar-context-id statusbar context-description) @result{} context-id
+@end lisp
 
+Returns a context identifier, given a description of the actual context. Note that the description is not shown in the UI.
 
+@var{context-description} is a string - textual description of what context the new message is being used in
+
+@RMethod statusbar-push
+@lisp
+(statusbar-push statusbar context text) @result{} message-id
+@end lisp
+
+Pushes a new message onto a statusbar's stack.
+
+@var{context}: a string (context description) or a number obtained by @ref{statusbar-context-id}
+
+@var{text}: the message to add to the statusbar
+
+@var{message-id}: a message id that can be used with @ref{statusbar-remove}.
+
+@RMethod statusbar-pop
+@lisp
+(statusbar-pop statusbar context)
+@end lisp
+
+Removes the first message in the @ref{statusbar}'s stack with the given context.
+
+Note that this may not change the displayed message, if the message at the top of the stack has a different context.
+
+@var{context}: a string (context description) or a number obtained by @ref{statusbar-context-id}
+
+@RMethod statusbar-remove
+@lisp
+(statusbar-remove statusbar context message-id)
+@end lisp
+
+Forces the removal of a message from a statusbar's stack. The exact @var{context} and @var{message-id} must be specified.
+
+@var{context}: a string (context description) or a number obtained by @ref{statusbar-context-id}
+
+@var{message-id}: a message identifier returned by @ref{statusbar-push}
 
 @node table
 @section table
@@ -3338,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