Hoogle Search
Within LTS Haskell 24.45 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
module GI.Gtk.Objects.
AccelMap Accelerator maps are used to define runtime configurable accelerators. Functions for manipulating them are are usually used by higher level convenience mechanisms like UIManager and are thus considered “low-level”. You’ll want to use them if you’re manually creating menus that should have user-configurable accelerators. An accelerator is uniquely defined by: * accelerator path * accelerator key * accelerator modifiers The accelerator path must consist of “<WINDOWTYPE>/Category1/Category2/.../Action”, where WINDOWTYPE should be a unique application-specific identifier that corresponds to the kind of window the accelerator is being used in, e.g. “Gimp-Image”, “Abiword-Document” or “Gnumeric-Settings”. The “Category1/.../Action” portion is most appropriately chosen by the action the accelerator triggers, i.e. for accelerators on menu items, choose the item’s menu path, e.g. “File/Save As”, “Image/View/Zoom” or “Edit/Select All”. So a full valid accelerator path may look like: “<Gimp-Toolbox>/File/Dialogs/Tool Options...”. All accelerators are stored inside one global AccelMap that can be obtained using accelMapGet. See [Monitoring changes][monitoring-changes] for additional details.
Manipulating accelerators
New accelerators can be added using accelMapAddEntry. To search for specific accelerator, use accelMapLookupEntry. Modifications of existing accelerators should be done using accelMapChangeEntry. In order to avoid having some accelerators changed, they can be locked using accelMapLockPath. Unlocking is done using accelMapUnlockPath.Saving and loading accelerator maps
Accelerator maps can be saved to and loaded from some external resource. For simple saving and loading from file, accelMapSave and accelMapLoad are provided. Saving and loading can also be done by providing file descriptor to accelMapSaveFd and accelMapLoadFd.Monitoring changes
AccelMap object is only useful for monitoring changes of accelerators. By connecting to AccelMap::changed signal, one can monitor changes of all accelerators. It is also possible to monitor only single accelerator path by using it as a detail of the AccelMap::changed signal.-
gi-gtk3 GI.Gtk.Objects.AccelMap Memory-managed wrapper type.
AccelMap :: ManagedPtr AccelMap -> AccelMapgi-gtk3 GI.Gtk.Objects.AccelMap No documentation available.
type
AccelMapChangedCallback = Text -> Word32 -> [ModifierType] -> IO ()gi-gtk3 GI.Gtk.Objects.AccelMap Notifies of a change in the global accelerator map. The path is also used as the detail for the signal, so it is possible to connect to changed::accel_path. Since: 2.4
class (GObject o, IsDescendantOf AccelMap o) =>
IsAccelMap ogi-gtk3 GI.Gtk.Objects.AccelMap Type class for types which can be safely cast to AccelMap, for instance with toAccelMap.
accelMapAddEntry :: (HasCallStack, MonadIO m) => Text -> Word32 -> [ModifierType] -> m ()gi-gtk3 GI.Gtk.Objects.AccelMap Registers a new accelerator with the global accelerator map. This function should only be called once per accelPath with the canonical accelKey and accelMods for this path. To change the accelerator during runtime programatically, use accelMapChangeEntry. Set accelKey and accelMods to 0 to request a removal of the accelerator. Note that accelPath string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with internStaticString.
accelMapAddFilter :: (HasCallStack, MonadIO m) => Text -> m ()gi-gtk3 GI.Gtk.Objects.AccelMap Adds a filter to the global list of accel path filters. Accel map entries whose accel path matches one of the filters are skipped by accelMapForeach. This function is intended for GTK+ modules that create their own menus, but don’t want them to be saved into the applications accelerator map dump.
-
gi-gtk3 GI.Gtk.Objects.AccelMap Changes the accelKey and accelMods currently associated with accelPath. Due to conflicts with other accelerators, a change may not always be possible, replace indicates whether other accelerators may be deleted to resolve such conflicts. A change will only occur if all conflicts could be resolved (which might not be the case if conflicting accelerators are locked). Successful changes are indicated by a True return value. Note that accelPath string will be stored in a GQuark. Therefore, if you pass a static string, you can save some memory by interning it first with internStaticString.
accelMapForeach :: (HasCallStack, MonadIO m) => Ptr () -> AccelMapForeach -> m ()gi-gtk3 GI.Gtk.Objects.AccelMap Loops over the entries in the accelerator map whose accel path doesn’t match any of the filters added with accelMapAddFilter, and execute foreachFunc on each. The signature of foreachFunc is that of AccelMapForeach, the changed parameter indicates whether this accelerator was changed during runtime (thus, would need saving during an accelerator map dump).
accelMapForeachUnfiltered :: (HasCallStack, MonadIO m) => Ptr () -> AccelMapForeach -> m ()gi-gtk3 GI.Gtk.Objects.AccelMap Loops over all entries in the accelerator map, and execute foreachFunc on each. The signature of foreachFunc is that of AccelMapForeach, the changed parameter indicates whether this accelerator was changed during runtime (thus, would need saving during an accelerator map dump).