File: testmodule.py

package info (click to toggle)
pygobject-2 2.28.6-10
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 7,988 kB
  • sloc: xml: 20,728; ansic: 18,670; python: 16,282; sh: 11,109; makefile: 868
file content (21 lines) | stat: -rw-r--r-- 575 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import gobject

class PyGObject(gobject.GObject):
    __gtype_name__ = 'PyGObject'
    __gproperties__ = {
        'label': (gobject.TYPE_STRING,
                  'label property',
                  'the label of the object',
                  'default', gobject.PARAM_READWRITE),
        }

    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]