From: Dana Jansens Date: Wed, 4 Dec 2002 11:25:43 +0000 (+0000) Subject: make setStyle() recursive X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;h=7dc834cc93efb9a4181ba7d29a72d49e596e9746;p=chaz%2Fopenbox make setStyle() recursive --- diff --git a/otk/widget.cc b/otk/widget.cc index e95848a6..6423a7af 100644 --- a/otk/widget.cc +++ b/otk/widget.cc @@ -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) diff --git a/otk/widget.hh b/otk/widget.hh index 57973e9b..249a4e28 100644 --- a/otk/widget.hh +++ b/otk/widget.hh @@ -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; }