Add GtkScaleButton documentation
[cl-gtk2.git] / doc / gtk.widgets.texi
index 37e2748..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
@@ -2761,18 +2840,74 @@ Signals:
 @Class progress-bar
 Superclass: @ref{progress} @ref{atk-implementor-iface} @ref{buildable}
 
+The @ref{progress-bar} is typically used to display the progress of a long running operation. It provides a visual clue that processing is underway. The @ref{progress-bar} can be used in two different modes: percentage mode and activity  mode.
+
+When an application can determine how much work needs to take place (e.g. read a fixed number of bytes from a file) and can monitor its progress, it can use the @ref{progress-bar} in percentage mode and the user sees a growing bar indicating the percentage of the work that has been completed. In this mode, the application is required to set @SlotRef{progress-bar,fraction} periodically to update the progress bar.
+
+When an application has no accurate way of knowing the amount of work to do, it can use the @ref{progress-bar} in activity mode, which shows activity by a block moving back and forth within the progress area. In this mode, the application is required to call @ref{progress-bar-pulse} perodically to update the progress bar.
+
+There is quite a bit of flexibility provided to control the appearance of the @ref{progress-bar}. Functions are provided to control the orientation of the bar, optional text can be displayed along with the bar, and the step size used in activity mode can be set.
+
 Slots:
 @itemize
 @item @anchor{slot.progress-bar.activity-blocks}activity-blocks. Type: @code{integer}. Accessor: @anchor{fn.progress-bar-activity-blocks}@code{progress-bar-activity-blocks}.
+
+The number of blocks which can fit in the progress bar area in activity mode (Deprecated).
+
+Allowed values: >= 2
+
+Default value: 5
 @item @anchor{slot.progress-bar.activity-step}activity-step. Type: @code{integer}. Accessor: @anchor{fn.progress-bar-activity-step}@code{progress-bar-activity-step}.
+
+The increment used for each iteration in activity mode (Deprecated).
+
+Default value: 3
 @item @anchor{slot.progress-bar.adjustment}adjustment. Type: @ref{adjustment}. Accessor: @anchor{fn.progress-bar-adjustment}@code{progress-bar-adjustment}.
+
+The @ref{adjustment} connected to the progress bar (Deprecated
 @item @anchor{slot.progress-bar.bar-style}bar-style. Type: @ref{progress-bar-style}. Accessor: @anchor{fn.progress-bar-bar-style}@code{progress-bar-bar-style}.
+
+Specifies the visual style of the bar in percentage mode (Deprecated).
+
+Default value: @EnumVRef{progress-bar-style,continuous}
 @item @anchor{slot.progress-bar.discrete-blocks}discrete-blocks. Type: @code{integer}. Accessor: @anchor{fn.progress-bar-discrete-blocks}@code{progress-bar-discrete-blocks}.
-@item @anchor{slot.progress-bar.ellipsize}ellipsize. Type: @code{PangoEllipsizeMode}. Accessor: @anchor{fn.progress-bar-ellipsize}@code{progress-bar-ellipsize}.
+
+The number of discrete blocks in a progress bar (when shown in the discrete style).
+
+Allowed values: >= 2
+
+Default value: 10
+@item @anchor{slot.progress-bar.ellipsize}ellipsize. Type: @ref{pango-ellipsize-mode}. Accessor: @anchor{fn.progress-bar-ellipsize}@code{progress-bar-ellipsize}.
+
+The preferred place to ellipsize the string, if the progressbar does not have enough room to display the entire string.
+
+Note that setting this property to a value other than @EnumVRef{pango-ellipsize-mode,none} has the side-effect that the progressbar requests only enough space to display the ellipsis "...". Another means to set a progressbar's width is @SlotRef{widget,width-request}.
+
+Default value: @EnumVRef{pango-ellipsize-mode,none}
 @item @anchor{slot.progress-bar.fraction}fraction. Type: @code{double-float}. Accessor: @anchor{fn.progress-bar-fraction}@code{progress-bar-fraction}.
+
+The fraction of total work that has been completed.
+
+Allowed values: [0,1]
+
+Default value: 0
 @item @anchor{slot.progress-bar.orientation}orientation. Type: @ref{progress-bar-orientation}. Accessor: @anchor{fn.progress-bar-orientation}@code{progress-bar-orientation}.
+
+Orientation and growth direction of the progress bar.
+
+Default value: @EnumVRef{progress-bar-orientation,left-to-right}
 @item @anchor{slot.progress-bar.pulse-step}pulse-step. Type: @code{double-float}. Accessor: @anchor{fn.progress-bar-pulse-step}@code{progress-bar-pulse-step}.
+
+The fraction of total progress to move the bouncing block when pulsed.
+
+Allowed values: [0,1]
+
+Default value: 0.1
 @item @anchor{slot.progress-bar.text}text. Type: @code{string}. Accessor: @anchor{fn.progress-bar-text}@code{progress-bar-text}.
+
+Text to be displayed in the progress bar.
+
+Default value: NIL
 @end itemize
 
 
@@ -2780,23 +2915,37 @@ Signals:
 @itemize
 @end itemize
 
+@RMethod progress-bar-pulse
+@lisp
+(progress-bar-pulse progress-bar)
+@end lisp
 
-
+Indicates that some progress is made, but you don't know how much. Causes the progress bar to enter "activity mode," where a block bounces back and forth. Each call to @ref{progress-bar-pulse} causes the block to move by a little bit (the amount of movement per pulse is determined by @SlotRef{progress-bar,pulse-step}).
 
 @node radio-button
 @section radio-button
 @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
 
 
@@ -2976,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
 
 
@@ -3148,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
@@ -3278,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