Connect to Changed signal.
Returns this, for use in with statements.
Registers a new accelerator with the global accelerator map. This function should only be called once per accel_path with the canonical accel_key and accel_mods for this path. To change the accelerator during runtime programatically, use gtk.accel_map.AccelMap.changeEntry.
Adds a filter to the global list of accel path filters.
Get builder for gtk.accel_map.AccelMap
Changes the accel_key and accel_mods currently associated with accel_path. 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.
Loops over all entries in the accelerator map, and execute foreach_func on each. The signature of foreach_func is that of #GtkAccelMapForeach, the changed parameter indicates whether this accelerator was changed during runtime (thus, would need saving during an accelerator map dump).
Loops over the entries in the accelerator map whose accel path doesn’t match any of the filters added with gtk.accel_map.AccelMap.addFilter, and execute foreach_func on each. The signature of foreach_func is that of #GtkAccelMapForeach, the changed parameter indicates whether this accelerator was changed during runtime (thus, would need saving during an accelerator map dump).
Gets the singleton global #GtkAccelMap object. This object is useful only for notification of changes to the accelerator map via the ::changed signal; it isn’t a parameter to the other accelerator map functions.
Parses a file previously saved with gtk.accel_map.AccelMap.save for accelerator specifications, and propagates them accordingly.
Filedescriptor variant of gtk.accel_map.AccelMap.load.
#GScanner variant of gtk.accel_map.AccelMap.load.
Locks the given accelerator path. If the accelerator map doesn’t yet contain an entry for accel_path, a new one is created.
Looks up the accelerator entry for accel_path and fills in key.
Saves current accelerator specifications (accelerator path, key and modifiers) to file_name. The file is written in a format suitable to be read back in by gtk.accel_map.AccelMap.load.
Filedescriptor variant of gtk.accel_map.AccelMap.save.
Undoes the last call to gtk.accel_map.AccelMap.lockPath on this accel_path. Refer to gtk.accel_map.AccelMap.lockPath for information about accelerator path locking.
Set the GObject of a D ObjectWrap wrapper.
Get a pointer to the underlying C object.
Calls g_object_ref() on a GObject.
Calls g_object_unref() on a GObject.
Get the GType of an object.
GObject GType property.
Convenience method to return this cast to a type. For use in D with statements.
Template to get the D object from a C GObject and cast it to the given D object type.
Connect a D closure to an object signal.
Template for setting a GObject property.
Template for getting a GObject property.
Creates a binding between source_property on source and target_property on target.
Creates a binding between source_property on source and target_property on target, allowing you to set the transformation functions to be used by the binding.
This function is intended for #GObject implementations to re-enforce a floating[floating-ref] object reference. Doing this is seldom required: all #GInitiallyUnowneds are created with a floating reference which usually just needs to be sunken by calling gobject.object.ObjectWrap.refSink.
Increases the freeze count on object. If the freeze count is non-zero, the emission of "notify" signals on object is stopped. The signals are queued until the freeze count is decreased to zero. Duplicate notifications are squashed so that at most one #GObject::notify signal is emitted for each property modified while the object is frozen.
Gets a named field from the objects table of associations (see gobject.object.ObjectWrap.setData).
Gets a property of an object.
This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata.
Gets n_properties properties for an object. Obtained properties will be set to values. All properties must be valid. Warnings will be emitted and undefined behaviour may result if invalid properties are passed in.
Checks whether object has a floating[floating-ref] reference.
Emits a "notify" signal for the property property_name on object.
Emits a "notify" signal for the property specified by pspec on object.
Increase the reference count of object, and possibly remove the floating[floating-ref] reference, if object has a floating reference.
Releases all references to other objects. This can be used to break reference cycles.
Each object carries around a table of associations from strings to pointers. This function lets you set an association.
Sets a property on an object.
Remove a specified datum from the object's data associations, without invoking the association's destroy handler.
This function gets back user data pointers stored via gobject.object.ObjectWrap.setQdata and removes the data from object without invoking its destroy() function (if any was set). Usually, calling this function is only required to update user data pointers with a destroy notifier, for example:
Reverts the effect of a previous call to gobject.object.ObjectWrap.freezeNotify. The freeze count is decreased on object and when it reaches zero, queued "notify" signals are emitted.
This function essentially limits the life time of the closure to the life time of the object. That is, when the object is finalized, the closure is invalidated by calling gobject.closure.Closure.invalidate on it, in order to prevent invocations of the closure with a finalized (nonexisting) object. Also, gobject.object.ObjectWrap.ref_ and gobject.object.ObjectWrap.unref are added as marshal guards to the closure, to ensure that an extra reference count is held on object during invocation of the closure. Usually, this function will be called on closures that use this object as closure data.
Connect to Notify signal.
Accelerator maps are used to define runtime configurable accelerators. Functions for manipulating them are are usually used by higher level convenience mechanisms like #GtkUIManager 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:
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 #GtkAccelMap that can be obtained using gtk.accel_map.AccelMap.get. See [Monitoring changes][monitoring-changes] for additional details.
Manipulating accelerators
New accelerators can be added using gtk.accel_map.AccelMap.addEntry. To search for specific accelerator, use gtk.accel_map.AccelMap.lookupEntry. Modifications of existing accelerators should be done using gtk.accel_map.AccelMap.changeEntry.
In order to avoid having some accelerators changed, they can be locked using gtk.accel_map.AccelMap.lockPath. Unlocking is done using gtk.accel_map.AccelMap.unlockPath.
Saving and loading accelerator maps
Accelerator maps can be saved to and loaded from some external resource. For simple saving and loading from file, gtk.accel_map.AccelMap.save and gtk.accel_map.AccelMap.load are provided. Saving and loading can also be done by providing file descriptor to gtk.accel_map.AccelMap.saveFd and gtk.accel_map.AccelMap.loadFd.
Monitoring changes
#GtkAccelMap object is only useful for monitoring changes of accelerators. By connecting to #GtkAccelMap::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 #GtkAccelMap::changed signal.