Costales
Costales

Reputation: 2883

How can I get all the property names of a GTK Container?

I'd like to know all the property names of a GTK.Container, then I could get/set them with child_get_property method.

I didn't find a list of all the properties. How could I know those properties in Python?

Thanks in advance!

Upvotes: 0

Views: 380

Answers (1)

felipsmartins
felipsmartins

Reputation: 13559

Use the built-in function dir().

>>> dir(object)
['__class__', '__delattr__', '__doc__'...]


>>> dir(gtk.Container)

Also, you could use inspect module

>>> import inspect
>>> inspect.getmembers(gtk.Container)

Upvotes: 1

Related Questions