Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does gobject.type_register() do?

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?

like image 295
Nathan Avatar asked Oct 28 '11 09:10

Nathan


1 Answers

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.

like image 121
ptomato Avatar answered Oct 25 '22 13:10

ptomato