Dazzle.StateMachine

g Dazzle.StateMachine Dazzle.StateMachine GObject.GInterface GObject.GInterface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable GObject.Object GObject.Object GObject.Object->Dazzle.StateMachine Gtk.Buildable->Dazzle.StateMachine

Subclasses:

None

Methods

Inherited:

GObject.Object (37), Gtk.Buildable (10)

Structs:

GObject.ObjectClass (5)

class

new ()

add_binding (state, source_object, source_property, target_object, target_property, flags)

add_propertyv (state, object, property, value)

add_style (state, widget, style)

create_action (name)

get_state ()

is_state (state)

set_state (state)

Virtual Methods

Inherited:

GObject.Object (7), Gtk.Buildable (10)

Properties

Name

Type

Flags

Short Description

state

str

r/w

The current state of the machine.

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Name

Type

Access

Description

parent_instance

GObject.Object

r

Class Details

class Dazzle.StateMachine(**kwargs)
Bases:

GObject.Object, Gtk.Buildable

Abstract:

No

Structure:

Dazzle.StateMachineClass

classmethod new()
Return type:

Dazzle.StateMachine

add_binding(state, source_object, source_property, target_object, target_property, flags)
Parameters:
add_propertyv(state, object, property, value)
Parameters:
add_style(state, widget, style)
Parameters:
create_action(name)
Parameters:

name (str) – the name of the action.

Returns:

A newly created Gio.Action.

Return type:

Gio.Action

Creates a new Gio.Action with the name of name.

Setting the state of this action will toggle the state of the state machine. You should use GLib.Variant.new_string() or similar to create the state.

get_state()
Returns:

The current state of the machine.

Return type:

str

Gets the Dazzle.StateMachine :state property. This is the name of the current state of the machine.

is_state(state)
Parameters:

state (str or None) – the name of the state to check

Returns:

True if self is currently set to state.

Return type:

bool

Checks to see if the current state of the Dazzle.StateMachine matches state.

New in version 3.28.

set_state(state)
Parameters:

state (str) –

Sets the Dazzle.StateMachine :state property.

Registered state transformations will be applied during the state transformation.

If the transition results in a cyclic operation, the state will stop at the last state before the cycle was detected.

Property Details

Dazzle.StateMachine.props.state
Name:

state

Type:

str

Default Value:

None

Flags:

READABLE, WRITABLE

The current state of the machine.