Atk.RelationSet

g Atk.RelationSet Atk.RelationSet GObject.Object GObject.Object GObject.Object->Atk.RelationSet

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new ()

add (relation)

add_relation_by_type (relationship, target)

contains (relationship)

contains_target (relationship, target)

get_n_relations ()

get_relation (i)

get_relation_by_type (relationship)

remove (relation)

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent

GObject.Object

r

relations

[object]

r

Class Details

class Atk.RelationSet(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

Atk.RelationSetClass

A set of AtkRelations, normally the set of AtkRelations which an Atk.Object has.

The Atk.RelationSet held by an object establishes its relationships with objects beyond the normal “parent/child” hierarchical relationships that all user interface objects have. AtkRelationSets establish whether objects are labelled or controlled by other components, share group membership with other components (for instance within a radio-button group), or share content which “flows” between them, among other types of possible relationships.

classmethod new()[source]
Returns:

a new Atk.RelationSet

Return type:

Atk.RelationSet

Creates a new empty relation set.

add(relation)[source]
Parameters:

relation (Atk.Relation) – an Atk.Relation

Add a new relation to the current relation set if it is not already present. This function ref’s the Atk.Relation so the caller of this function should unref it to ensure that it will be destroyed when the Atk.RelationSet is destroyed.

add_relation_by_type(relationship, target)[source]
Parameters:

Add a new relation of the specified type with the specified target to the current relation set if the relation set does not contain a relation of that type. If it is does contain a relation of that typea the target is added to the relation.

New in version 1.9.

contains(relationship)[source]
Parameters:

relationship (Atk.RelationType) – an Atk.RelationType

Returns:

True if relationship is the relationship type of a relation in self, False otherwise

Return type:

bool

Determines whether the relation set contains a relation that matches the specified type.

contains_target(relationship, target)[source]
Parameters:
Returns:

True if self contains a relation with the relationship type relationship with an object target, False otherwise

Return type:

bool

Determines whether the relation set contains a relation that matches the specified pair formed by type relationship and object target.

get_n_relations()[source]
Returns:

an integer representing the number of relations in the set.

Return type:

int

Determines the number of relations in a relation set.

get_relation(i)[source]
Parameters:

i (int) – a int representing a position in the set, starting from 0.

Returns:

a Atk.Relation, which is the relation at position i in the set.

Return type:

Atk.Relation

Determines the relation at the specified position in the relation set.

get_relation_by_type(relationship)[source]
Parameters:

relationship (Atk.RelationType) – an Atk.RelationType

Returns:

an Atk.Relation, which is a relation matching the specified type.

Return type:

Atk.Relation

Finds a relation that matches the specified type.

remove(relation)[source]
Parameters:

relation (Atk.Relation) – an Atk.Relation

Removes a relation from the relation set. This function unref’s the Atk.Relation so it will be deleted unless there is another reference to it.