ScaleButton

#GtkScaleButton 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 #GtkVolumeButton subclass that is tailored for this use case.

CSS nodes

GtkScaleButton has a single CSS node with name button. To differentiate it from a plain #GtkButton, it gets the .scale style class.

The popup widget that contains the scale has a .scale-popup style class.

Constructors

this
this(void* ptr, Flag!"Take" take)
this
this(gtk.types.IconSize size, double min, double max, double step, string[] icons)

Creates a #GtkScaleButton, with a range between min and max, with a stepping of step.

Members

Functions

connectPopdown
gulong connectPopdown(T callback, Flag!"After" after)

Connect to Popdown signal.

connectPopup
gulong connectPopup(T callback, Flag!"After" after)

Connect to Popup signal.

connectValueChanged
gulong connectValueChanged(T callback, Flag!"After" after)

Connect to ValueChanged signal.

getAdjustment
gtk.adjustment.Adjustment getAdjustment()

Gets the #GtkAdjustment associated with the #GtkScaleButton’s scale. See gtk.range.Range.getAdjustment for details.

getMinusButton
gtk.button.Button getMinusButton()

Retrieves the minus button of the #GtkScaleButton.

getPlusButton
gtk.button.Button getPlusButton()

Retrieves the plus button of the #GtkScaleButton.

getPopup
gtk.widget.Widget getPopup()

Retrieves the popup of the #GtkScaleButton.

getValue
double getValue()

Gets the current value of the scale button.

self
ScaleButton self()

Returns this, for use in with statements.

setAdjustment
void setAdjustment(gtk.adjustment.Adjustment adjustment)

Sets the #GtkAdjustment to be used as a model for the #GtkScaleButton’s scale. See gtk.range.Range.setAdjustment for details.

setIcons
void setIcons(string[] icons)

Sets the icons to be used by the scale button. For details, see the #GtkScaleButton:icons property.

setValue
void setValue(double value)

Sets the current value of the scale; if the value is outside the minimum or maximum range values, it will be clamped to fit inside them. The scale button emits the #GtkScaleButton::value-changed signal if the value changes.

Properties

_gType
GType _gType [@property getter]
adjustment
gtk.adjustment.Adjustment adjustment [@property getter]
adjustment
gtk.adjustment.Adjustment adjustment [@property setter]
size
gtk.types.IconSize size [@property getter]
size
gtk.types.IconSize size [@property setter]
value
double value [@property getter]
value
double value [@property setter]

Static functions

_getGType
GType _getGType()
builder
ScaleButtonGidBuilder builder()

Get builder for gtk.scale_button.ScaleButton

Mixed In Members

From mixin OrientableT!()

orientation
gtk.types.Orientation orientation [@property getter]

Get orientation property.

orientation
gtk.types.Orientation orientation [@property setter]

Set orientation property.

getOrientation
gtk.types.Orientation getOrientation()

Retrieves the orientation of the orientable.

setOrientation
void setOrientation(gtk.types.Orientation orientation)

Sets the orientation of the orientable.

Inherited Members

From Button

_getGType
GType _getGType()
_gType
GType _gType [@property getter]
self
Button self()

Returns this, for use in with statements.

builder
ButtonGidBuilder builder()

Get builder for gtk.button.Button

alwaysShowImage
bool alwaysShowImage [@property getter]

Get alwaysShowImage property.

alwaysShowImage
bool alwaysShowImage [@property setter]

Set alwaysShowImage property.

image
gtk.widget.Widget image [@property getter]

Get image property.

image
gtk.widget.Widget image [@property setter]

Set image property.

imagePosition
gtk.types.PositionType imagePosition [@property getter]

Get imagePosition property.

imagePosition
gtk.types.PositionType imagePosition [@property setter]

Set imagePosition property.

label
string label [@property getter]
label
string label [@property setter]
relief
gtk.types.ReliefStyle relief [@property getter]
relief
gtk.types.ReliefStyle relief [@property setter]
useStock
bool useStock [@property getter]
useStock
bool useStock [@property setter]
useUnderline
bool useUnderline [@property getter]
useUnderline
bool useUnderline [@property setter]
xalign
float xalign [@property getter]

Get xalign property.

xalign
float xalign [@property setter]

Set xalign property.

yalign
float yalign [@property getter]

Get yalign property.

yalign
float yalign [@property setter]

Set yalign property.

newFromIconName
gtk.button.Button newFromIconName(string iconName, gtk.types.IconSize size)

Creates a new button containing an icon from the current icon theme.

newFromStock
gtk.button.Button newFromStock(string stockId)

Creates a new #GtkButton containing the image and text from a [stock item]gtkstock. Some stock ids have preprocessor macros like #GTK_STOCK_OK and #GTK_STOCK_APPLY.

newWithLabel
gtk.button.Button newWithLabel(string label)

Creates a #GtkButton widget with a #GtkLabel child containing the given text.

newWithMnemonic
gtk.button.Button newWithMnemonic(string label)

Creates a new #GtkButton containing a label. If characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use “__” (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.

clicked
void clicked()

Emits a #GtkButton::clicked signal to the given #GtkButton.

enter
void enter()

Emits a #GtkButton::enter signal to the given #GtkButton.

getAlignment
void getAlignment(float xalign, float yalign)

Gets the alignment of the child in the button.

getAlwaysShowImage
bool getAlwaysShowImage()

Returns whether the button will ignore the #GtkSettings:gtk-button-images setting and always show the image, if available.

getEventWindow
gdk.window.Window getEventWindow()

Returns the button’s event window if it is realized, null otherwise. This function should be rarely needed.

getFocusOnClick
bool getFocusOnClick()

Returns whether the button grabs focus when it is clicked with the mouse. See gtk.button.Button.setFocusOnClick.

getImage
gtk.widget.Widget getImage()

Gets the widget that is currenty set as the image of button. This may have been explicitly set by gtk.button.Button.setImage or constructed by gtk.button.Button.newFromStock.

getImagePosition
gtk.types.PositionType getImagePosition()

Gets the position of the image relative to the text inside the button.

getLabel
string getLabel()

Fetches the text from the label of the button, as set by gtk.button.Button.setLabel. If the label text has not been set the return value will be null. This will be the case if you create an empty button with gtk.button.Button.new_ to use as a container.

getRelief
gtk.types.ReliefStyle getRelief()

Returns the current relief style of the given #GtkButton.

getUseStock
bool getUseStock()

Returns whether the button label is a stock item.

getUseUnderline
bool getUseUnderline()

Returns whether an embedded underline in the button label indicates a mnemonic. See gtk_button_set_use_underline ().

leave
void leave()

Emits a #GtkButton::leave signal to the given #GtkButton.

pressed
void pressed()

Emits a #GtkButton::pressed signal to the given #GtkButton.

released
void released()

Emits a #GtkButton::released signal to the given #GtkButton.

setAlignment
void setAlignment(float xalign, float yalign)

Sets the alignment of the child. This property has no effect unless the child is a #GtkMisc or a #GtkAlignment.

setAlwaysShowImage
void setAlwaysShowImage(bool alwaysShow)

If true, the button will ignore the #GtkSettings:gtk-button-images setting and always show the image, if available.

setFocusOnClick
void setFocusOnClick(bool focusOnClick)

Sets whether the button will grab focus when it is clicked with the mouse. Making mouse clicks not grab focus is useful in places like toolbars where you don’t want the keyboard focus removed from the main area of the application.

setImage
void setImage(gtk.widget.Widget image)

Set the image of button to the given widget. The image will be displayed if the label text is null or if #GtkButton:always-show-image is true. You don’t have to call gtk.widget.Widget.show on image yourself.

setImagePosition
void setImagePosition(gtk.types.PositionType position)

Sets the position of the image relative to the text inside the button.

setLabel
void setLabel(string label)

Sets the text of the label of the button to str. This text is also used to select the stock item if gtk.button.Button.setUseStock is used.

setRelief
void setRelief(gtk.types.ReliefStyle relief)

Sets the relief style of the edges of the given #GtkButton widget. Two styles exist, gtk.types.ReliefStyle.Normal and gtk.types.ReliefStyle.None. The default style is, as one can guess, gtk.types.ReliefStyle.Normal. The deprecated value gtk.types.ReliefStyle.Half behaves the same as gtk.types.ReliefStyle.Normal.

setUseStock
void setUseStock(bool useStock)

If true, the label set on the button is used as a stock id to select the stock item for the button.

setUseUnderline
void setUseUnderline(bool useUnderline)

If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.

connectActivate
gulong connectActivate(T callback, Flag!"After" after)

Connect to Activate signal.

connectClicked
gulong connectClicked(T callback, Flag!"After" after)

Connect to Clicked signal.

connectEnter
gulong connectEnter(T callback, Flag!"After" after)

Connect to Enter signal.

connectLeave
gulong connectLeave(T callback, Flag!"After" after)

Connect to Leave signal.

connectPressed
gulong connectPressed(T callback, Flag!"After" after)

Connect to Pressed signal.

connectReleased
gulong connectReleased(T callback, Flag!"After" after)

Connect to Released signal.

From Orientable

_getGType
GType _getGType()
orientation
gtk.types.Orientation orientation [@property getter]

Get orientation property.

orientation
gtk.types.Orientation orientation [@property setter]

Set orientation property.

getOrientation
gtk.types.Orientation getOrientation()

Retrieves the orientation of the orientable.

setOrientation
void setOrientation(gtk.types.Orientation orientation)

Sets the orientation of the orientable.