File: testmodule.py

package info (click to toggle)
pygobject 3.22.0-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 5,492 kB
  • ctags: 5,045
  • sloc: ansic: 20,987; python: 15,991; sh: 4,659; makefile: 569; xml: 31
file content (23 lines) | stat: -rw-r--r-- 647 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from gi.repository import GObject


class PyGObject(GObject.GObject):
    __gtype_name__ = 'PyGObject'
    __gproperties__ = {
        'label': (GObject.TYPE_STRING,
                  'label property',
                  'the label of the object',
                  'default',
                  GObject.ParamFlags.READABLE | GObject.ParamFlags.WRITABLE),
        }

    def __init__(self):
        self._props = {}
        GObject.GObject.__init__(self)
        self.set_property('label', 'hello')

    def do_set_property(self, name, value):
        self._props[name] = value

    def do_get_property(self, name):
        return self._props[name]