GUI Properties#

arcade.gui.DictProperty#

class arcade.gui.DictProperty[source]#

Property that represents a dict. Only dict are allowed. Any other classes are forbidden.

arcade.gui.ListProperty#

class arcade.gui.ListProperty[source]#

Property that represents a list. Only list are allowed. Any other classes are forbidden.

arcade.gui.Property#

class arcade.gui.Property(default=None, default_factory=None)[source]#

An observable property which triggers observers when changed.

arcade.gui.bind#

arcade.gui.bind(instance, property: str, callback)[source]#

Binds a function to the change event of the property. A reference to the function will be kept, so that it will be still invoked, even if it would normally have been garbage collected.

def log_change():

print(“Something changed”)

class MyObject:

name = Property()

my_obj = MyObject() bind(my_obj, “name”, log_change)

my_obj.name = “Hans” # > Something changed

Parameters
  • instance – Instance owning the property

  • property – Name of the property

  • callback – Function to call

Returns

None