| FAQ Index - Search - Recent Changes - Everything - Add entry |
7.2. Where is GtkLabel.get_text()?
I don't know why the API is inconsistent, but the GtkLabel provides the method get() instead of get_text().
l = gtk.Label("foobar")
print l.get() # prints "foobar"
In PyGTK-2 you can use get_text() method:
>>> l = gtk.Label("foobar")
>>> print l.get_text()
foobar
>>>
and also get() method still works:
>>> print l.get() foobar
