gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.ShortcutsSection

Contents

- Exported types
- Methods
  - addGroup
- Properties
  - maxHeight
  - sectionName
  - title
  - viewName
- Signals
  - changeCurrentPage

Description

A `GtkShortcutsSection` collects all the keyboard shortcuts and gestures for a major application mode.

If your application needs multiple sections, you should give each section a unique ShortcutsSection:sectionName and a ShortcutsSection:title that can be shown in the section selector of the `ShortcutsWindow`.

The ShortcutsSection:maxHeight property can be used to influence how the groups in the section are distributed over pages and columns.

This widget is only meant to be used with `ShortcutsWindow`.

The recommended way to construct a `GtkShortcutsSection` is with `Builder`, by using the `<child>` tag to populate a `GtkShortcutsSection` with one or more `ShortcutsGroup` instances, which in turn contain one or more `ShortcutsShortcut` objects.

If you need to add a group programmatically, use `shortcutsSectionAddGroup`.

# Shortcuts and Gestures

Pan gestures allow to navigate between sections.

The following signals have default keybindings:

- ShortcutsSection::changeCurrentPage

Synopsis

- newtype ShortcutsSection = ShortcutsSection (ManagedPtr ShortcutsSection)
- class (GObject o, IsDescendantOf ShortcutsSection o) => IsShortcutsSection o
- toShortcutsSection :: (MonadIO m, IsShortcutsSection o) => o -> m ShortcutsSection
- shortcutsSectionAddGroup :: (HasCallStack, MonadIO m, IsShortcutsSection a, IsShortcutsGroup b) => a -> b -> m ()
- constructShortcutsSectionMaxHeight :: (IsShortcutsSection o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getShortcutsSectionMaxHeight :: (MonadIO m, IsShortcutsSection o) => o -> m Word32
- setShortcutsSectionMaxHeight :: (MonadIO m, IsShortcutsSection o) => o -> Word32 -> m ()
- clearShortcutsSectionSectionName :: (MonadIO m, IsShortcutsSection o) => o -> m ()
- constructShortcutsSectionSectionName :: (IsShortcutsSection o, MonadIO m) => Text -> m (GValueConstruct o)
- getShortcutsSectionSectionName :: (MonadIO m, IsShortcutsSection o) => o -> m (Maybe Text)
- setShortcutsSectionSectionName :: (MonadIO m, IsShortcutsSection o) => o -> Text -> m ()
- clearShortcutsSectionTitle :: (MonadIO m, IsShortcutsSection o) => o -> m ()
- constructShortcutsSectionTitle :: (IsShortcutsSection o, MonadIO m) => Text -> m (GValueConstruct o)
- getShortcutsSectionTitle :: (MonadIO m, IsShortcutsSection o) => o -> m (Maybe Text)
- setShortcutsSectionTitle :: (MonadIO m, IsShortcutsSection o) => o -> Text -> m ()
- clearShortcutsSectionViewName :: (MonadIO m, IsShortcutsSection o) => o -> m ()
- constructShortcutsSectionViewName :: (IsShortcutsSection o, MonadIO m) => Text -> m (GValueConstruct o)
- getShortcutsSectionViewName :: (MonadIO m, IsShortcutsSection o) => o -> m (Maybe Text)
- setShortcutsSectionViewName :: (MonadIO m, IsShortcutsSection o) => o -> Text -> m ()
- type ShortcutsSectionChangeCurrentPageCallback = Int32 -> IO Bool
- afterShortcutsSectionChangeCurrentPage :: (IsShortcutsSection a, MonadIO m) => a -> ((?self :: a) => ShortcutsSectionChangeCurrentPageCallback) -> m SignalHandlerId
- onShortcutsSectionChangeCurrentPage :: (IsShortcutsSection a, MonadIO m) => a -> ((?self :: a) => ShortcutsSectionChangeCurrentPageCallback) -> m SignalHandlerId

# Exported types

newtype ShortcutsSection Source #

Memory-managed wrapper type.

Constructors

ShortcutsSection (ManagedPtr ShortcutsSection) |

#### Instances

Instances details

Eq ShortcutsSection Source # |
Instance details Defined in GI.Gtk.Objects.ShortcutsSection Methods (==) :: ShortcutsSection -> ShortcutsSection -> Bool Source # (/=) :: ShortcutsSection -> ShortcutsSection -> Bool Source #
GObject ShortcutsSection Source # |
Instance details Defined in GI.Gtk.Objects.ShortcutsSection
ManagedPtrNewtype ShortcutsSection Source # |
Instance details Defined in GI.Gtk.Objects.ShortcutsSection Methods toManagedPtr :: ShortcutsSection -> ManagedPtr ShortcutsSection Source #
TypedObject ShortcutsSection Source # |
Instance details Defined in GI.Gtk.Objects.ShortcutsSection Methods glibType :: IO GType Source #
HasParentTypes ShortcutsSection Source # |
Instance details Defined in GI.Gtk.Objects.ShortcutsSection
IsGValue (Maybe ShortcutsSection) Source # | Convert `ShortcutsSection` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.ShortcutsSection Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe ShortcutsSection -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe ShortcutsSection) Source #
type ParentTypes ShortcutsSection Source # |
Instance details Defined in GI.Gtk.Objects.ShortcutsSection type ParentTypes ShortcutsSection = '[Box, Widget, Object, Accessible, Buildable, ConstraintTarget, Orientable]

class (GObject o, IsDescendantOf ShortcutsSection o) => IsShortcutsSection o Source #

Type class for types which can be safely cast to `ShortcutsSection`, for instance with `toShortcutsSection`.

#### Instances

Instances details

(GObject o, IsDescendantOf ShortcutsSection o) => IsShortcutsSection o Source # |
Instance details Defined in GI.Gtk.Objects.ShortcutsSection

toShortcutsSection :: (MonadIO m, IsShortcutsSection o) => o -> m ShortcutsSection Source #

Cast to `ShortcutsSection`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addGroup, addMnemonicLabel, addTickCallback, allocate, announce, append, bindProperty, bindPropertyFull, childFocus, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, insertChildAfter, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, prepend, queueAllocate, queueDraw, queueResize, realize, ref, refSink, remove, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, reorderChildAfter, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getBaseline, getBaselineChild, getBaselinePosition, getBounds, getBuildableId, getCanFocus, getCanTarget, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getHomogeneous, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOrientation, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getSpacing, getStateFlags, getStyleContext, getTemplateChild, getTooltipMarkup, getTooltipText, getValign, getVexpand, getVexpandSet, getVisible, getWidth.

#### Setters

setAccessibleParent, setBaselineChild, setBaselinePosition, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setHomogeneous, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setName, setOpacity, setOrientation, setOverflow, setParent, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setSpacing, setStateFlags, setTooltipMarkup, setTooltipText, setValign, setVexpand, setVexpandSet, setVisible.

## addGroup

shortcutsSectionAddGroup Source #

Arguments

:: (HasCallStack, MonadIO m, IsShortcutsSection a, IsShortcutsGroup b) |
=> a | `self`: a `GtkShortcutsSection`
-> b | `group`: the `GtkShortcutsGroup` to add
-> m () |

Deprecated: (Since version 4.18)This widget will be removed in GTK 5

Adds a group to the shortcuts section.

This is the programmatic equivalent to using `Builder` and a `<child>` tag to add the child.

Adding children with the `GtkBox` API is not appropriate, as `GtkShortcutsSection` manages its children internally.

Since: 4.14

# Properties

## maxHeight

The maximum number of lines to allow per column.

This property can be used to influence how the groups in this section are distributed across pages and columns. The default value of 15 should work in most cases.

constructShortcutsSectionMaxHeight :: (IsShortcutsSection o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`max-height`” property. This is rarely needed directly, but it is used by `new`.

getShortcutsSectionMaxHeight :: (MonadIO m, IsShortcutsSection o) => o -> m Word32 Source #

Get the value of the “`max-height`” property. When overloading is enabled, this is equivalent to

    get shortcutsSection #maxHeight

setShortcutsSectionMaxHeight :: (MonadIO m, IsShortcutsSection o) => o -> Word32 -> m () Source #

Set the value of the “`max-height`” property. When overloading is enabled, this is equivalent to

    set shortcutsSection [ #maxHeight := value ]

## sectionName

A unique name to identify this section among the sections added to the `GtkShortcutsWindow`.

Setting the ShortcutsWindow:sectionName property to this string will make this section shown in the `GtkShortcutsWindow`.

clearShortcutsSectionSectionName :: (MonadIO m, IsShortcutsSection o) => o -> m () Source #

Set the value of the “`section-name`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #sectionName

constructShortcutsSectionSectionName :: (IsShortcutsSection o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`section-name`” property. This is rarely needed directly, but it is used by `new`.

getShortcutsSectionSectionName :: (MonadIO m, IsShortcutsSection o) => o -> m (Maybe Text) Source #

Get the value of the “`section-name`” property. When overloading is enabled, this is equivalent to

    get shortcutsSection #sectionName

setShortcutsSectionSectionName :: (MonadIO m, IsShortcutsSection o) => o -> Text -> m () Source #

Set the value of the “`section-name`” property. When overloading is enabled, this is equivalent to

    set shortcutsSection [ #sectionName := value ]

## title

The string to show in the section selector of the `GtkShortcutsWindow` for this section.

If there is only one section, you don't need to set a title, since the section selector will not be shown in this case.

clearShortcutsSectionTitle :: (MonadIO m, IsShortcutsSection o) => o -> m () Source #

Set the value of the “`title`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #title

constructShortcutsSectionTitle :: (IsShortcutsSection o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`title`” property. This is rarely needed directly, but it is used by `new`.

getShortcutsSectionTitle :: (MonadIO m, IsShortcutsSection o) => o -> m (Maybe Text) Source #

Get the value of the “`title`” property. When overloading is enabled, this is equivalent to

    get shortcutsSection #title

setShortcutsSectionTitle :: (MonadIO m, IsShortcutsSection o) => o -> Text -> m () Source #

Set the value of the “`title`” property. When overloading is enabled, this is equivalent to

    set shortcutsSection [ #title := value ]

## viewName

A view name to filter the groups in this section by.

See ShortcutsGroup:view.

Applications are expected to use the ShortcutsWindow:viewName property for this purpose.

clearShortcutsSectionViewName :: (MonadIO m, IsShortcutsSection o) => o -> m () Source #

Set the value of the “`view-name`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #viewName

constructShortcutsSectionViewName :: (IsShortcutsSection o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`view-name`” property. This is rarely needed directly, but it is used by `new`.

getShortcutsSectionViewName :: (MonadIO m, IsShortcutsSection o) => o -> m (Maybe Text) Source #

Get the value of the “`view-name`” property. When overloading is enabled, this is equivalent to

    get shortcutsSection #viewName

setShortcutsSectionViewName :: (MonadIO m, IsShortcutsSection o) => o -> Text -> m () Source #

Set the value of the “`view-name`” property. When overloading is enabled, this is equivalent to

    set shortcutsSection [ #viewName := value ]

# Signals

## changeCurrentPage

type ShortcutsSectionChangeCurrentPageCallback Source #

Arguments

= Int32 | `offset`: the offset
-> IO Bool | Returns: whether the page was changed

Deprecated: (Since version 4.18)This widget will be removed in GTK 5

Emitted when we change the current page.

The default bindings for this signal are <kbd>Ctrl</kbd>+<kbd>PgUp</kbd>, <kbd>PgUp</kbd>, <kbd>Ctrl</kbd>+<kbd>PgDn</kbd>, <kbd>PgDn</kbd>.

afterShortcutsSectionChangeCurrentPage :: (IsShortcutsSection a, MonadIO m) => a -> ((?self :: a) => ShortcutsSectionChangeCurrentPageCallback) -> m SignalHandlerId Source #

Connect a signal handler for the changeCurrentPage signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after shortcutsSection #changeCurrentPage callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onShortcutsSectionChangeCurrentPage :: (IsShortcutsSection a, MonadIO m) => a -> ((?self :: a) => ShortcutsSectionChangeCurrentPageCallback) -> m SignalHandlerId Source #

Connect a signal handler for the changeCurrentPage signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on shortcutsSection #changeCurrentPage callback