Frage

In PyGTK, what does gobject.type_register() do? The documentation merely says

registers the specified Python class as a PyGTK type

Well, duh. What does registering a class as a PyGtk type do?

War es hilfreich?

Lösung

A PyGTK type can be used as the type of a PyGTK property. To be known to the GObject type system, a type has to be registered. I don't think you actually have to call this function in PyGTK, it is probably done automatically when you call __gobject_init__.

Sometimes the PyGTK docs are too succinct. In that case you might want to read the C docs.

Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top