2.3 <GActionMap>

Interface: <GActionMap>

<GActionMap> is an interface for action containers.

The <GActionMap> interface is implemented by <GActionGroup> implementations that operate by containing a number of named <GAction> instances, such as <GSimpleActionGroup>.

One useful application of this interface is to map the names of actions from various action groups to unique, prefixed names (e.g. by prepending "app." or "win."). This is the motivation for the ‘Map’ part of the interface name.

Procedures

Method: action-map:add-action self action
Method: add-action self action

Adds an action to the self.

If the action map already contains an action with the same name as action then the old action is dropped from the action map.

The action map takes its own reference on action.

self

Passed: a <GActionMap>.

an action map

action

Passed: a <GAction>.

a <GAction>

Method: action-map:lookup-action self action-name ⇒ %return
Method: lookup-action self action-name ⇒ %return

Looks up the action with the name action-name in self.

If no such action exists, returns NULL.

self

Passed: a <GActionMap>.

an action map

action-name

Passed: a string.

the name of an action

%return

Returned: a <GAction>, or #f.

a <GAction>

Method: action-map:remove-action self action-name
Method: remove-action self action-name

Removes the named action from the action map.

If no action of this name is in the map then nothing happens.

self

Passed: a <GActionMap>.

an action map

action-name

Passed: a string.

the name of the action

Virtual methods

Virtual method: action-map:do-add-action implementor self action

Adds an action to the self.

If the action map already contains an action with the same name as action then the old action is dropped from the action map.

The action map takes its own reference on action.

To override it in a new class, give register-type #:vfuncs `((add-action . ,procedure)). The procedure is called as (procedure self action).

implementor

Passed: the class whose implementation to call: a class that implements <GActionMap>, or its GType number.

self

Passed: a <GActionMap>.

an action map

action

Passed: a <GAction>.

a <GAction>

Virtual method: action-map:do-lookup-action implementor self action-name ⇒ %return

Looks up the action with the name action-name in self.

If no such action exists, returns NULL.

To override it in a new class, give register-type #:vfuncs `((lookup-action . ,procedure)). The procedure is called as (procedure self action-name) ⇒ %return.

implementor

Passed: the class whose implementation to call: a class that implements <GActionMap>, or its GType number.

self

Passed: a <GActionMap>.

an action map

action-name

Passed: a string.

the name of an action

%return

Returned: a <GAction>, or #f.

a <GAction>

Virtual method: action-map:do-remove-action implementor self action-name

Removes the named action from the action map.

If no action of this name is in the map then nothing happens.

To override it in a new class, give register-type #:vfuncs `((remove-action . ,procedure)). The procedure is called as (procedure self action-name).

implementor

Passed: the class whose implementation to call: a class that implements <GActionMap>, or its GType number.

self

Passed: a <GActionMap>.

an action map

action-name

Passed: a string.

the name of the action