From 7dc834cc93efb9a4181ba7d29a72d49e596e9746 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 4 Dec 2002 11:25:43 +0000 Subject: [PATCH] make setStyle() recursive --- otk/widget.cc | 11 +++++++++++ otk/widget.hh | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) 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; } -- 2.45.2