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
)
16 GObject
.type_register(MyObject
)
18 print("MyObject properties: ", list(MyObject
.props
))
22 print("obj.foo ==", obj
.foo
)
25 print("obj.foo = spam")
27 print("obj.foo == ", obj
.foo
)
29 print("obj.boolprop == ", obj
.boolprop
)
32 obj
.readonly
= 'does-not-work'