In the Wt classes, three keep std::vectors of their children WObject,
WWebWidget and WContainerWidget, but only WContainerWidget has a children()
method to access them.
In the Qt api, the QObject class has a public children() method and I use
the method in the QtRuby bindings for marking ruby instances as not needing
garbage collection. In RubyWt I am having problems with some widgets being
garbage collected early because I have no means of walking the trees of
children in the mark phase of GC. Would it be possible to add these
children() methods to Wt?
--- Wt/WObject 2008-07-15 07:25:50.000000000 +0100
+++ Wt.patched/WObject 2008-09-03 19:44:46.000000000 +0100
@@ -217,6 +217,10 @@
*/
void removeChild(WObject *child);
+ /*! \brief Get the children.
+ */
+ const std::vector<WObject *>& children() const { return *children_; }
+
/*! \brief Get the parent object.
*/
WObject *parent() const { return parent_; }
diff -Naur Wt/WWebWidget Wt.patched/WWebWidget
--- Wt/WWebWidget 2008-07-22 07:03:07.000000000 +0100
+++ Wt.patched/WWebWidget 2008-09-03 19:43:00.000000000 +0100
@@ -129,6 +129,10 @@
*/
void setLoadLaterWhenInvisible(bool);
+ /*! \brief Get the children.
+ */
+ const std::vector<WWidget *>& children() const { return *children_; }
+
/*! \brief Escape HTML control characters in the text, to display
literally.
*/
static WString escapeText(const WString& text, bool newlinesToo = false);
Another small thing, the children() method in WContainerWidget is virtual,
and I'm not sure that it really needs to be.
-- Richard
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest