1 from gi
.repository
import GObject
4 class MyObject(GObject
.GObject
):
6 foo
= GObject
.Property(type=str, default
='bar')
7 boolprop
= GObject
.Property(type=bool, default
=False)
10 GObject
.GObject
.__init
__(self
)
17 GObject
.type_register(MyObject
)
19 print("MyObject properties: ", list(MyObject
.props
))
23 print("obj.foo ==", obj
.foo
)
26 print("obj.foo = spam")
28 print("obj.foo == ", obj
.foo
)
30 print("obj.boolprop == ", obj
.boolprop
)
33 obj
.readonly
= 'does-not-work'