make setStyle() recursive

This commit is contained in:
Dana Jansens 2002-12-04 11:25:43 +00:00
parent 772ff27864
commit 7dc834cc93
2 changed files with 12 additions and 1 deletions

View file

@ -420,6 +420,17 @@ void OtkWidget::removeChild(OtkWidget *child)
_children.erase(it);
}
void OtkWidget::setStyle(Style *style)
{
assert(style);
_style = style;
_dirty = true;
OtkWidgetList::iterator it, end = _children.end();
for (it = _children.begin(); it != end; ++it)
(*it)->setStyle(style);
}
void OtkWidget::setEventDispatcher(OtkEventDispatcher *disp)
{
if (_event_dispatcher)

View file

@ -101,7 +101,7 @@ public:
void setDirection(Direction dir) { _direction = dir; }
inline Style *getStyle(void) const { return _style; }
virtual void setStyle(Style *style) { assert(style); _style = style; }
virtual void setStyle(Style *style);
inline OtkEventDispatcher *getEventDispatcher(void)
{ return _event_dispatcher; }