Add Widget::findChildT<>() member function.

This commit is contained in:
David Capello 2010-12-04 15:56:28 -03:00
parent 93f1584717
commit 5605ae81e0

View File

@ -250,6 +250,13 @@ public:
Widget* findChild(const char* name);
Widget* findSibling(const char* name);
// Finds a child with the specified name and dynamic-casts it to
// type T.
template<class T>
T* findChildT(const char* name) {
return dynamic_cast<T*>(findChild(name));
}
void dirty() {
jwidget_dirty(this);
}