| 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.ShortcutsWindow
Description
A GtkShortcutsWindow shows information about the keyboard shortcuts
and gestures of an application.
The shortcuts can be grouped, and you can have multiple sections in this window, corresponding to the major modes of your application.
Additionally, the shortcuts can be filtered by the current view, to avoid showing information that is not relevant in the current application context.
The recommended way to construct a GtkShortcutsWindow is with
Builder, by using the <child> tag to populate a
GtkShortcutsWindow with one or more ShortcutsSection objects,
which contain one or more ShortcutsGroup instances, which, in turn,
contain ShortcutsShortcut instances.
If you need to add a section programmatically, use shortcutsWindowAddSection
instead of windowSetChild, as the shortcuts window manages
its children directly.
A simple example:

This example has as single section. As you can see, the shortcut groups are arranged in columns, and spread across several pages if there are too many to find on a single page.
The .ui file for this example can be found here.
An example with multiple views:

This example shows a GtkShortcutsWindow that has been configured to show only
the shortcuts relevant to the "stopwatch" view.
The .ui file for this example can be found here.
An example with multiple sections:

This example shows a GtkShortcutsWindow with two sections, "Editor Shortcuts"
and "Terminal Shortcuts".
The .ui file for this example can be found here.
Shortcuts and Gestures
The following signals have default keybindings:
CSS nodes
GtkShortcutsWindow has a single CSS node with the name window and style
class .shortcuts.
Synopsis
- newtype ShortcutsWindow = ShortcutsWindow (ManagedPtr ShortcutsWindow)
- class (GObject o, IsDescendantOf ShortcutsWindow o) => IsShortcutsWindow o
- toShortcutsWindow :: (MonadIO m, IsShortcutsWindow o) => o -> m ShortcutsWindow
- shortcutsWindowAddSection :: (HasCallStack, MonadIO m, IsShortcutsWindow a, IsShortcutsSection b) => a -> b -> m ()
- clearShortcutsWindowSectionName :: (MonadIO m, IsShortcutsWindow o) => o -> m ()
- constructShortcutsWindowSectionName :: (IsShortcutsWindow o, MonadIO m) => Text -> m (GValueConstruct o)
- getShortcutsWindowSectionName :: (MonadIO m, IsShortcutsWindow o) => o -> m (Maybe Text)
- setShortcutsWindowSectionName :: (MonadIO m, IsShortcutsWindow o) => o -> Text -> m ()
- clearShortcutsWindowViewName :: (MonadIO m, IsShortcutsWindow o) => o -> m ()
- constructShortcutsWindowViewName :: (IsShortcutsWindow o, MonadIO m) => Text -> m (GValueConstruct o)
- getShortcutsWindowViewName :: (MonadIO m, IsShortcutsWindow o) => o -> m (Maybe Text)
- setShortcutsWindowViewName :: (MonadIO m, IsShortcutsWindow o) => o -> Text -> m ()
- type ShortcutsWindowCloseCallback = IO ()
- afterShortcutsWindowClose :: (IsShortcutsWindow a, MonadIO m) => a -> ((?self :: a) => ShortcutsWindowCloseCallback) -> m SignalHandlerId
- onShortcutsWindowClose :: (IsShortcutsWindow a, MonadIO m) => a -> ((?self :: a) => ShortcutsWindowCloseCallback) -> m SignalHandlerId
- type ShortcutsWindowSearchCallback = IO ()
- afterShortcutsWindowSearch :: (IsShortcutsWindow a, MonadIO m) => a -> ((?self :: a) => ShortcutsWindowSearchCallback) -> m SignalHandlerId
- onShortcutsWindowSearch :: (IsShortcutsWindow a, MonadIO m) => a -> ((?self :: a) => ShortcutsWindowSearchCallback) -> m SignalHandlerId
Exported types
newtype ShortcutsWindow Source #
Memory-managed wrapper type.
Constructors
| ShortcutsWindow (ManagedPtr ShortcutsWindow) |
Instances
class (GObject o, IsDescendantOf ShortcutsWindow o) => IsShortcutsWindow o Source #
Type class for types which can be safely cast to ShortcutsWindow, for instance with toShortcutsWindow.
Instances
| (GObject o, IsDescendantOf ShortcutsWindow o) => IsShortcutsWindow o Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
toShortcutsWindow :: (MonadIO m, IsShortcutsWindow o) => o -> m ShortcutsWindow Source #
Cast to ShortcutsWindow, 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
Methods
actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addSection, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, childFocus, close, computeBounds, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, destroy, disposeTemplate, dragCheckThreshold, errorBell, forceFloating, freezeNotify, fullscreen, fullscreenOnMonitor, getv, grabFocus, hasCssClass, hasDefault, hasFocus, hasGroup, hasVisibleFocus, hide, inDestruction, initTemplate, insertActionGroup, insertAfter, insertBefore, isActive, isAncestor, isDrawable, isFloating, isFocus, isFullscreen, isMaximized, isSensitive, isSuspended, isVisible, keynavFailed, listMnemonicLabels, map, maximize, measure, minimize, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, present, presentWithTime, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unfullscreen, unmap, unmaximize, unminimize, unparent, unrealize, unref, unsetStateFlags, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.
Getters
getAccessibleParent, getAccessibleRole, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getApplication, getAtContext, getBaseline, getBounds, getBuildableId, getCanFocus, getCanTarget, getChild, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDecorated, getDefaultSize, getDefaultWidget, getDeletable, getDestroyWithParent, getDirection, getDisplay, getFirstAccessibleChild, getFirstChild, getFocus, getFocusChild, getFocusOnClick, getFocusVisible, getFocusable, getFontMap, getFontOptions, getFrameClock, getGroup, getHalign, getHandleMenubarAccel, getHasTooltip, getHeight, getHexpand, getHexpandSet, getHideOnClose, getIconName, getLastChild, getLayoutManager, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMnemonicsVisible, getModal, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getPangoContext, getParent, getPlatformState, getPreferredSize, getPrevSibling, getPrimaryClipboard, getProperty, getQdata, getRealized, getReceivesDefault, getRenderer, getRequestMode, getResizable, getRoot, getScaleFactor, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getSurface, getSurfaceTransform, getTemplateChild, getTitle, getTitlebar, getTooltipMarkup, getTooltipText, getTransientFor, getValign, getVexpand, getVexpandSet, getVisible, getWidth.
Setters
setAccessibleParent, setApplication, setCanFocus, setCanTarget, setChild, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDecorated, setDefaultSize, setDefaultWidget, setDeletable, setDestroyWithParent, setDirection, setDisplay, setFocus, setFocusChild, setFocusOnClick, setFocusVisible, setFocusable, setFontMap, setFontOptions, setHalign, setHandleMenubarAccel, setHasTooltip, setHexpand, setHexpandSet, setHideOnClose, setIconName, setLayoutManager, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMnemonicsVisible, setModal, setName, setOpacity, setOverflow, setParent, setProperty, setReceivesDefault, setResizable, setSensitive, setSizeRequest, setStartupId, setStateFlags, setTitle, setTitlebar, setTooltipMarkup, setTooltipText, setTransientFor, setValign, setVexpand, setVexpandSet, setVisible.
addSection
shortcutsWindowAddSection Source #
Arguments
| :: (HasCallStack, MonadIO m, IsShortcutsWindow a, IsShortcutsSection b) | |
| => a |
|
| -> b |
|
| -> m () |
Adds a section to the shortcuts window.
This is the programmatic equivalent to using Builder and a
<child> tag to add the child.
Using windowSetChild is not appropriate as the shortcuts
window manages its children internally.
Since: 4.14
Properties
sectionName
The name of the section to show.
This should be the section-name of one of the GtkShortcutsSection
objects that are in this shortcuts window.
clearShortcutsWindowSectionName :: (MonadIO m, IsShortcutsWindow o) => o -> m () Source #
Set the value of the “section-name” property to Nothing.
When overloading is enabled, this is equivalent to
clear #sectionName
constructShortcutsWindowSectionName :: (IsShortcutsWindow 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.
getShortcutsWindowSectionName :: (MonadIO m, IsShortcutsWindow o) => o -> m (Maybe Text) Source #
Get the value of the “section-name” property.
When overloading is enabled, this is equivalent to
get shortcutsWindow #sectionName
setShortcutsWindowSectionName :: (MonadIO m, IsShortcutsWindow o) => o -> Text -> m () Source #
Set the value of the “section-name” property.
When overloading is enabled, this is equivalent to
setshortcutsWindow [ #sectionName:=value ]
viewName
The view name by which to filter the contents.
This should correspond to the ShortcutsGroup:view
property of some of the ShortcutsGroup objects that
are inside this shortcuts window.
Set this to Nothing to show all groups.
clearShortcutsWindowViewName :: (MonadIO m, IsShortcutsWindow o) => o -> m () Source #
Set the value of the “view-name” property to Nothing.
When overloading is enabled, this is equivalent to
clear #viewName
constructShortcutsWindowViewName :: (IsShortcutsWindow 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.
getShortcutsWindowViewName :: (MonadIO m, IsShortcutsWindow o) => o -> m (Maybe Text) Source #
Get the value of the “view-name” property.
When overloading is enabled, this is equivalent to
get shortcutsWindow #viewName
setShortcutsWindowViewName :: (MonadIO m, IsShortcutsWindow o) => o -> Text -> m () Source #
Set the value of the “view-name” property.
When overloading is enabled, this is equivalent to
setshortcutsWindow [ #viewName:=value ]
Signals
close
type ShortcutsWindowCloseCallback = IO () Source #
Emitted when the user uses a keybinding to close the window.
This is a keybinding signal.
The default binding for this signal is the <kbd>Escape</kbd> key.
afterShortcutsWindowClose :: (IsShortcutsWindow a, MonadIO m) => a -> ((?self :: a) => ShortcutsWindowCloseCallback) -> m SignalHandlerId Source #
Connect a signal handler for the close signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after shortcutsWindow #close 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.
onShortcutsWindowClose :: (IsShortcutsWindow a, MonadIO m) => a -> ((?self :: a) => ShortcutsWindowCloseCallback) -> m SignalHandlerId Source #
Connect a signal handler for the close signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on shortcutsWindow #close callback
search
type ShortcutsWindowSearchCallback = IO () Source #
Emitted when the user uses a keybinding to start a search.
This is a keybinding signal.
The default binding for this signal is <kbd>Control</kbd>+<kbd>F</kbd>.
afterShortcutsWindowSearch :: (IsShortcutsWindow a, MonadIO m) => a -> ((?self :: a) => ShortcutsWindowSearchCallback) -> m SignalHandlerId Source #
Connect a signal handler for the search signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after shortcutsWindow #search 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.
onShortcutsWindowSearch :: (IsShortcutsWindow a, MonadIO m) => a -> ((?self :: a) => ShortcutsWindowSearchCallback) -> m SignalHandlerId Source #
Connect a signal handler for the search signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on shortcutsWindow #search callback