Package ch.bailu.gtk.adw
Klasse SplitButton
- Alle implementierten Schnittstellen:
PointerInterface
A combined button and dropdown widget.
<picture>
<source srcset="split-button-dark.png" media="(prefers-color-scheme: dark)">
<img src="split-button.png" alt="split-button">
</picture>
`AdwSplitButton` is typically used to present a set of actions in a menu,
but allow access to one of them with a single click.
The API is very similar to [class@Gtk.Button] and [class@Gtk.MenuButton], see
their documentation for details.
## CSS nodes
```
splitbutton[.image-button][.text-button]
├── button
│ ╰── <content>
├── separator
╰── menubutton
╰── button.toggle
╰── arrow
```
`AdwSplitButton`'s CSS node is called `splitbutton`. It contains the css
nodes: `button`, `separator`, `menubutton`. See [class@Gtk.MenuButton]
documentation for the `menubutton` contents.
The main CSS node will contain the `.image-button` or `.text-button` style
classes matching the button contents. The nested button nodes will never
contain them.
## Style classes
`AdwSplitButton` can use some of the same style classes as [class@Gtk.Button]:
- [`.suggested-action`](style-classes.html#suggested-action)
- [`.destructive-action`](style-classes.html#destructive-action)
- [`.flat`](style-classes.html#flat)
- [`.raised`](style-classes.html#raised)
Other style classes, like `.pill`, cannot be used.
## Accessibility
`AdwSplitButton` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
<picture>
<source srcset="split-button-dark.png" media="(prefers-color-scheme: dark)">
<img src="split-button.png" alt="split-button">
</picture>
`AdwSplitButton` is typically used to present a set of actions in a menu,
but allow access to one of them with a single click.
The API is very similar to [class@Gtk.Button] and [class@Gtk.MenuButton], see
their documentation for details.
## CSS nodes
```
splitbutton[.image-button][.text-button]
├── button
│ ╰── <content>
├── separator
╰── menubutton
╰── button.toggle
╰── arrow
```
`AdwSplitButton`'s CSS node is called `splitbutton`. It contains the css
nodes: `button`, `separator`, `menubutton`. See [class@Gtk.MenuButton]
documentation for the `menubutton` contents.
The main CSS node will contain the `.image-button` or `.text-button` style
classes matching the button contents. The nested button nodes will never
contain them.
## Style classes
`AdwSplitButton` can use some of the same style classes as [class@Gtk.Button]:
- [`.suggested-action`](style-classes.html#suggested-action)
- [`.destructive-action`](style-classes.html#destructive-action)
- [`.flat`](style-classes.html#flat)
- [`.raised`](style-classes.html#raised)
Other style classes, like `.pill`, cannot be used.
## Accessibility
`AdwSplitButton` uses the `GTK_ACCESSIBLE_ROLE_GROUP` role.
https://gnome.pages.gitlab.gnome.org/libadwaita/doc/main/class.SplitButton.html
-
Verschachtelte Klassen - Übersicht
Verschachtelte KlassenModifizierer und TypKlasseBeschreibungstatic interface
static interface
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gtk.Widget
Widget.OnDestroy, Widget.OnDestroyNotify, Widget.OnDirectionChanged, Widget.OnHide, Widget.OnKeynavFailed, Widget.OnMap, Widget.OnMnemonicActivate, Widget.OnMoveFocus, Widget.OnQueryTooltip, Widget.OnRealize, Widget.OnShow, Widget.OnStateFlagsChanged, Widget.OnTickCallback, Widget.OnUnmap, Widget.OnUnrealize
Von Klasse geerbte verschachtelte Klassen/Schnittstellen ch.bailu.gtk.gobject.Object
Object.OnBindingTransformFunc, Object.OnDuplicateFunc, Object.OnNotify, Object.OnToggleNotify, Object.OnWeakNotify
-
Feldübersicht
FelderVon Klasse geerbte Felder ch.bailu.gtk.gtk.Widget
SIGNAL_ON_DESTROY, SIGNAL_ON_DIRECTION_CHANGED, SIGNAL_ON_HIDE, SIGNAL_ON_KEYNAV_FAILED, SIGNAL_ON_MAP, SIGNAL_ON_MNEMONIC_ACTIVATE, SIGNAL_ON_MOVE_FOCUS, SIGNAL_ON_QUERY_TOOLTIP, SIGNAL_ON_REALIZE, SIGNAL_ON_SHOW, SIGNAL_ON_STATE_FLAGS_CHANGED, SIGNAL_ON_UNMAP, SIGNAL_ON_UNREALIZE
Von Klasse geerbte Felder ch.bailu.gtk.gobject.Object
SIGNAL_ON_NOTIFY
-
Konstruktorübersicht
Konstruktoren -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungImplements interfaceAccessible
.Implements interfaceActionable
.Implements interfaceBuildable
.Implements interfaceConstraintTarget
.boolean
gets whether the button can be smaller than the natural size of its contents.getChild()
Gets the child widget.static ClassHandler
int
Gets the direction in which the popup will be popped up.Gets the tooltip of the dropdown button of @self.Gets the name of the icon used to automatically populate the button.static int
getLabel()
Gets the label for @self.Gets the menu model from which the popup will be created.static long
static TypeSystem.TypeSize
Gets the popover that will be popped up when the dropdown is clicked.static long
static TypeSystem.TypeSize
boolean
Gets whether an underline in the text indicates a mnemonic.onActivate
(SplitButton.OnActivate signal) Connect to signal "activate".onClicked
(SplitButton.OnClicked signal) Connect to signal "clicked".void
popdown()
Dismisses the menu.void
popup()
Pops up the menu.void
setCanShrink
(boolean can_shrink) Sets whether the button can be smaller than the natural size of its contents.void
Sets the child widget.void
setDirection
(int direction) Sets the direction in which the popup will be popped up.void
setDropdownTooltip
(Str tooltip) Sets the tooltip of the dropdown button of @self.void
setDropdownTooltip
(String tooltip) Sets the tooltip of the dropdown button of @self.void
setIconName
(Str icon_name) Sets the name of the icon used to automatically populate the button.void
setIconName
(String icon_name) Sets the name of the icon used to automatically populate the button.void
Sets the label for @self.void
Sets the label for @self.void
setMenuModel
(MenuModel menu_model) Sets the menu model from which the popup will be created.void
setPopover
(Popover popover) Sets the popover that will be popped up when the dropdown is clicked.void
setUseUnderline
(boolean use_underline) Sets whether an underline in the text indicates a mnemonic.Von Klasse geerbte Methoden ch.bailu.gtk.gtk.Widget
actionSetEnabled, actionSetEnabled, activate, activateAction, activateAction, activateActionVariant, activateActionVariant, activateDefault, addController, addCssClass, addCssClass, addMnemonicLabel, addTickCallback, allocate, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getBaseline, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getDefaultDirection, getDisplay, getFirstChild, getFocusable, getFocusChild, getFocusOnClick, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPreferredSize, getPrevSibling, getPrimaryClipboard, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTemplateChild, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth, grabFocus, hasCssClass, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertActionGroup, insertAfter, insertBefore, isAncestor, isDrawable, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, observeChildren, observeControllers, onDestroy, onDirectionChanged, onHide, onKeynavFailed, onMap, onMnemonicActivate, onMoveFocus, onQueryTooltip, onRealize, onShow, onStateFlagsChanged, onUnmap, onUnrealize, pick, queueAllocate, queueDraw, queueResize, realize, removeController, removeCssClass, removeCssClass, removeMnemonicLabel, removeTickCallback, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setCursorFromName, setDefaultDirection, setFocusable, setFocusChild, setFocusOnClick, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setName, setOpacity, setOverflow, setParent, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTooltipMarkup, setTooltipMarkup, setTooltipText, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible, shouldLayout, show, sizeAllocate, snapshotChild, triggerTooltipQuery, unmap, unparent, unrealize, unsetStateFlags
Von Klasse geerbte Methoden ch.bailu.gtk.type.PropertyHolder
getBooleanProperty, getIntProperty, getObjectProperty, getStringProperty, getStrProperty, setBooleanProperty, setIntProperty, setObjectProperty, setStringProperty, setStrProperty
Von Klasse geerbte Methoden ch.bailu.gtk.gobject.Object
addToggleRef, bindProperty, bindProperty, bindPropertyFull, bindPropertyFull, bindPropertyWithClosures, bindPropertyWithClosures, compatControl, connect, connect, disconnect, disconnect, dupData, dupData, dupQdata, forceFloating, freezeNotify, get, get, getData, getData, getProperty, getProperty, getQdata, interfaceFindProperty, interfaceInstallProperty, isFloating, notify, notify, notifyByPspec, onNotify, ref, refSink, removeToggleRef, replaceData, replaceData, replaceQdata, runDispose, set, set, setData, setData, setDataFull, setDataFull, setProperty, setProperty, setQdata, setQdataFull, stealData, stealData, stealQdata, takeRef, thawNotify, unref, watchClosure, weakRef, weakUnref
Von Klasse geerbte Methoden ch.bailu.gtk.type.Pointer
asCPointer, cast, connectSignal, disconnectSignals, disconnectSignals, equals, hashCode, throwIfNull, throwNullPointerException, toString, unregisterCallbacks, unregisterCallbacks
Von Klasse geerbte Methoden ch.bailu.gtk.type.Type
asCPointer, asCPointer, asCPointerNotNull, asJnaPointer, asJnaPointer, asPointer, asPointer, cast, cast, throwIfNull
Von Klasse geerbte Methoden java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Von Schnittstelle geerbte Methoden ch.bailu.gtk.type.PointerInterface
asCPointerNotNull, asJnaPointer, asPointer, isNotNull, isNull
-
Felddetails
-
SIGNAL_ON_ACTIVATE
- Siehe auch:
-
SIGNAL_ON_CLICKED
- Siehe auch:
-
-
Konstruktordetails
-
SplitButton
-
SplitButton
public SplitButton()Creates a new `AdwSplitButton`.
-
-
Methodendetails
-
getClassHandler
-
getCanShrink
public boolean getCanShrink()gets whether the button can be smaller than the natural size of its contents.- Gibt zurück:
- whether the button can shrink
-
getChild
Gets the child widget.- Gibt zurück:
- the child widget
-
getDirection
public int getDirection()Gets the direction in which the popup will be popped up.- Setzt außer Kraft:
getDirection
in KlasseWidget
- Gibt zurück:
- the direction
-
getDropdownTooltip
Gets the tooltip of the dropdown button of @self.- Gibt zurück:
- the dropdown tooltip of @self
-
getIconName
Gets the name of the icon used to automatically populate the button.- Gibt zurück:
- the icon name
-
getLabel
Gets the label for @self.- Gibt zurück:
- the label for @self
-
getMenuModel
Gets the menu model from which the popup will be created.- Gibt zurück:
- the menu model
-
getPopover
Gets the popover that will be popped up when the dropdown is clicked.- Gibt zurück:
- the popover
-
getUseUnderline
public boolean getUseUnderline()Gets whether an underline in the text indicates a mnemonic.- Gibt zurück:
- whether an underline in the text indicates a mnemonic
-
popdown
public void popdown()Dismisses the menu. -
popup
public void popup()Pops up the menu. -
setCanShrink
public void setCanShrink(boolean can_shrink) Sets whether the button can be smaller than the natural size of its contents.
If set to `TRUE`, the label will ellipsize.
See [method@Gtk.Button.set_can_shrink] and
[method@Gtk.MenuButton.set_can_shrink].- Parameter:
can_shrink
- whether the button can shrink
-
setChild
Sets the child widget.
Setting the child widget will set [property@SplitButton:label] and
[property@SplitButton:icon-name] to `NULL`.- Parameter:
child
- the new child widget
-
setDirection
public void setDirection(int direction) Sets the direction in which the popup will be popped up.
The dropdown arrow icon will point at the same direction.
If the does not fit in the available space in the given direction, GTK will
try its best to keep it inside the screen and fully visible.
If you pass `GTK_ARROW_NONE`, it's equivalent to `GTK_ARROW_DOWN`.- Setzt außer Kraft:
setDirection
in KlasseWidget
- Parameter:
direction
- the direction
-
setDropdownTooltip
Sets the tooltip of the dropdown button of @self.
The tooltip can be marked up with the Pango text markup language.- Parameter:
tooltip
- the dropdown tooltip of @self
-
setDropdownTooltip
Sets the tooltip of the dropdown button of @self.
The tooltip can be marked up with the Pango text markup language.- Parameter:
tooltip
- the dropdown tooltip of @self
-
setIconName
Sets the name of the icon used to automatically populate the button.
Setting the icon name will set [property@SplitButton:label] and
[property@SplitButton:child] to `NULL`.- Parameter:
icon_name
- the icon name to set
-
setIconName
Sets the name of the icon used to automatically populate the button.
Setting the icon name will set [property@SplitButton:label] and
[property@SplitButton:child] to `NULL`.- Parameter:
icon_name
- the icon name to set
-
setLabel
Sets the label for @self.
Setting the label will set [property@SplitButton:icon-name] and
[property@SplitButton:child] to `NULL`.- Parameter:
label
- the label to set
-
setLabel
Sets the label for @self.
Setting the label will set [property@SplitButton:icon-name] and
[property@SplitButton:child] to `NULL`.- Parameter:
label
- the label to set
-
setMenuModel
Sets the menu model from which the popup will be created.
If the menu model is `NULL`, the dropdown is disabled.
A [class@Gtk.Popover] will be created from the menu model with
[ctor@Gtk.PopoverMenu.new_from_model]. Actions will be connected as
documented for this function.
If [property@SplitButton:popover] is already set, it will be dissociated from
the button, and the property is set to `NULL`.- Parameter:
menu_model
- the menu model
-
setPopover
Sets the popover that will be popped up when the dropdown is clicked.
If the popover is `NULL`, the dropdown is disabled.
If [property@SplitButton:menu-model] is set, the menu model is dissociated
from the button, and the property is set to `NULL`.- Parameter:
popover
- the popover
-
setUseUnderline
public void setUseUnderline(boolean use_underline) Sets whether an underline in the text indicates a mnemonic.
See [property@SplitButton:label].- Parameter:
use_underline
- whether an underline in the text indicates a mnemonic
-
onActivate
Connect to signal "activate".
SeeSplitButton.OnActivate.onActivate()
for signal description.
FieldSIGNAL_ON_ACTIVATE
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
onClicked
Connect to signal "clicked".
SeeSplitButton.OnClicked.onClicked()
for signal description.
FieldSIGNAL_ON_CLICKED
contains original signal name and can be used as resource reference.- Parameter:
signal
- callback function (lambda).- Gibt zurück:
SignalHandler
. Can be used to disconnect signal and to release callback function.
-
asAccessible
Implements interfaceAccessible
. Call this to get access to interface functions.- Setzt außer Kraft:
asAccessible
in KlasseWidget
- Gibt zurück:
Accessible
-
asActionable
Implements interfaceActionable
. Call this to get access to interface functions.- Gibt zurück:
Actionable
-
asBuildable
Implements interfaceBuildable
. Call this to get access to interface functions.- Setzt außer Kraft:
asBuildable
in KlasseWidget
- Gibt zurück:
Buildable
-
asConstraintTarget
Implements interfaceConstraintTarget
. Call this to get access to interface functions.- Setzt außer Kraft:
asConstraintTarget
in KlasseWidget
- Gibt zurück:
ConstraintTarget
-
getTypeID
public static long getTypeID() -
getParentTypeID
public static long getParentTypeID() -
getTypeSize
-
getParentTypeSize
-
getInstanceSize
public static int getInstanceSize()
-