gi-gtk-3.0.24: Gtk bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.ShortcutsWindow

Contents

Description

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

Exported types

class GObject o => IsShortcutsWindow o Source #

Type class for types which can be safely cast to ShortcutsWindow, for instance with toShortcutsWindow.

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.

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

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

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

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