Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
Safe Haskell | None |
Language | Haskell2010 |
A GtkShortcutsWindow shows brief 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 GtkBuilder,
by populating a ShortcutsWindow
with one or more ShortcutsSection
objects, which contain GtkShortcutsGroups
that in turn contain objects of
class ShortcutsShortcut
.
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 ShortcutsWindow
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 ShortcutsWindow
with two sections, "Editor Shortcuts"
and "Terminal Shortcuts".
The .ui file for this example can be found here.
Synopsis
- newtype ShortcutsWindow = ShortcutsWindow (ManagedPtr ShortcutsWindow)
- class GObject o => IsShortcutsWindow o
- toShortcutsWindow :: (MonadIO m, IsShortcutsWindow o) => o -> m ShortcutsWindow
- noShortcutsWindow :: Maybe ShortcutsWindow
- clearShortcutsWindowSectionName :: (MonadIO m, IsShortcutsWindow o) => o -> m ()
- constructShortcutsWindowSectionName :: IsShortcutsWindow o => Text -> IO (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 => Text -> IO (GValueConstruct o)
- getShortcutsWindowViewName :: (MonadIO m, IsShortcutsWindow o) => o -> m (Maybe Text)
- setShortcutsWindowViewName :: (MonadIO m, IsShortcutsWindow o) => o -> Text -> m ()
- type C_ShortcutsWindowCloseCallback = Ptr () -> Ptr () -> IO ()
- type ShortcutsWindowCloseCallback = IO ()
- afterShortcutsWindowClose :: (IsShortcutsWindow a, MonadIO m) => a -> ShortcutsWindowCloseCallback -> m SignalHandlerId
- genClosure_ShortcutsWindowClose :: ShortcutsWindowCloseCallback -> IO Closure
- mk_ShortcutsWindowCloseCallback :: C_ShortcutsWindowCloseCallback -> IO (FunPtr C_ShortcutsWindowCloseCallback)
- noShortcutsWindowCloseCallback :: Maybe ShortcutsWindowCloseCallback
- onShortcutsWindowClose :: (IsShortcutsWindow a, MonadIO m) => a -> ShortcutsWindowCloseCallback -> m SignalHandlerId
- wrap_ShortcutsWindowCloseCallback :: ShortcutsWindowCloseCallback -> C_ShortcutsWindowCloseCallback
- type C_ShortcutsWindowSearchCallback = Ptr () -> Ptr () -> IO ()
- type ShortcutsWindowSearchCallback = IO ()
- afterShortcutsWindowSearch :: (IsShortcutsWindow a, MonadIO m) => a -> ShortcutsWindowSearchCallback -> m SignalHandlerId
- genClosure_ShortcutsWindowSearch :: ShortcutsWindowSearchCallback -> IO Closure
- mk_ShortcutsWindowSearchCallback :: C_ShortcutsWindowSearchCallback -> IO (FunPtr C_ShortcutsWindowSearchCallback)
- noShortcutsWindowSearchCallback :: Maybe ShortcutsWindowSearchCallback
- onShortcutsWindowSearch :: (IsShortcutsWindow a, MonadIO m) => a -> ShortcutsWindowSearchCallback -> m SignalHandlerId
- wrap_ShortcutsWindowSearchCallback :: ShortcutsWindowSearchCallback -> C_ShortcutsWindowSearchCallback
Exported types
newtype ShortcutsWindow Source #
Memory-managed wrapper type.
Instances
GObject ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow gobjectType :: ShortcutsWindow -> IO GType # | |
IsImplementorIface ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
IsObject ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
IsBuildable ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
IsBin ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
IsContainer ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
IsShortcutsWindow ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
IsWidget ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
IsWindow ShortcutsWindow Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow |
class GObject o => IsShortcutsWindow o Source #
Type class for types which can be safely cast to ShortcutsWindow
, for instance with toShortcutsWindow
.
Instances
(GObject a, (UnknownAncestorError ShortcutsWindow a :: Constraint)) => IsShortcutsWindow a Source # | |
Defined in GI.Gtk.Objects.ShortcutsWindow | |
IsShortcutsWindow ShortcutsWindow 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
.
noShortcutsWindow :: Maybe ShortcutsWindow Source #
A convenience alias for Nothing
:: Maybe
ShortcutsWindow
.
Properties
sectionName
The name of the section to show.
This should be the section-name of one of the ShortcutsSection
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 => Text -> IO (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
set
shortcutsWindow [ #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 => Text -> IO (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
set
shortcutsWindow [ #viewName:=
value ]
Signals
close
type C_ShortcutsWindowCloseCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ShortcutsWindowCloseCallback = IO () Source #
The ::close signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user uses a keybinding to close the window.
The default binding for this signal is the Escape key.
afterShortcutsWindowClose :: (IsShortcutsWindow a, MonadIO m) => 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
genClosure_ShortcutsWindowClose :: ShortcutsWindowCloseCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ShortcutsWindowCloseCallback :: C_ShortcutsWindowCloseCallback -> IO (FunPtr C_ShortcutsWindowCloseCallback) Source #
Generate a function pointer callable from C code, from a C_ShortcutsWindowCloseCallback
.
noShortcutsWindowCloseCallback :: Maybe ShortcutsWindowCloseCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ShortcutsWindowCloseCallback
onShortcutsWindowClose :: (IsShortcutsWindow a, MonadIO m) => 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
wrap_ShortcutsWindowCloseCallback :: ShortcutsWindowCloseCallback -> C_ShortcutsWindowCloseCallback Source #
Wrap a ShortcutsWindowCloseCallback
into a C_ShortcutsWindowCloseCallback
.
search
type C_ShortcutsWindowSearchCallback = Ptr () -> Ptr () -> IO () Source #
Type for the callback on the (unwrapped) C side.
type ShortcutsWindowSearchCallback = IO () Source #
The ::search signal is a [keybinding signal][GtkBindingSignal] which gets emitted when the user uses a keybinding to start a search.
The default binding for this signal is Control-F.
afterShortcutsWindowSearch :: (IsShortcutsWindow a, MonadIO m) => 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
genClosure_ShortcutsWindowSearch :: ShortcutsWindowSearchCallback -> IO Closure Source #
Wrap the callback into a Closure
.
mk_ShortcutsWindowSearchCallback :: C_ShortcutsWindowSearchCallback -> IO (FunPtr C_ShortcutsWindowSearchCallback) Source #
Generate a function pointer callable from C code, from a C_ShortcutsWindowSearchCallback
.
noShortcutsWindowSearchCallback :: Maybe ShortcutsWindowSearchCallback Source #
A convenience synonym for
.Nothing
:: Maybe
ShortcutsWindowSearchCallback
onShortcutsWindowSearch :: (IsShortcutsWindow a, MonadIO m) => 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