Atk.RelationSet¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
None
Signals¶
- Inherited:
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
||
relations |
[ |
r |
Class Details¶
- class Atk.RelationSet(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
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:
Creates a new empty relation set.
- add(relation)[source]¶
- Parameters:
relation (
Atk.Relation
) – anAtk.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 theAtk.RelationSet
is destroyed.
- add_relation_by_type(relationship, target)[source]¶
- Parameters:
relationship (
Atk.RelationType
) – anAtk.RelationType
target (
Atk.Object
) – anAtk.Object
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
) – anAtk.RelationType
- Returns:
True
if relationship is the relationship type of a relation in self,False
otherwise- Return type:
Determines whether the relation set contains a relation that matches the specified type.
- contains_target(relationship, target)[source]¶
- Parameters:
relationship (
Atk.RelationType
) – anAtk.RelationType
target (
Atk.Object
) – anAtk.Object
- Returns:
True
if self contains a relation with the relationship type relationship with an object target,False
otherwise- Return type:
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:
Determines the number of relations in a relation set.
- get_relation(i)[source]¶
- Parameters:
i (
int
) – aint
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:
Determines the relation at the specified position in the relation set.
- get_relation_by_type(relationship)[source]¶
- Parameters:
relationship (
Atk.RelationType
) – anAtk.RelationType
- Returns:
an
Atk.Relation
, which is a relation matching the specified type.- Return type:
Finds a relation that matches the specified type.
- remove(relation)[source]¶
- Parameters:
relation (
Atk.Relation
) – anAtk.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.