+void Widget::setStyle(Style *style)
+{
+ assert(style);
+ _style = style;
+ _dirty = true;
+
+ WidgetList::iterator it, end = _children.end();
+ for (it = _children.begin(); it != end; ++it)
+ (*it)->setStyle(style);
+}
+
+
+void Widget::setEventDispatcher(EventDispatcher *disp)
+{
+ if (_event_dispatcher)
+ _event_dispatcher->clearHandler(_window);
+ _event_dispatcher = disp;
+ _event_dispatcher->registerHandler(_window, this);
+}
+
+void Widget::exposeHandler(const XExposeEvent &e)
+{
+ EventHandler::exposeHandler(e);
+// XClearArea(**display, _window, e.x, e.y, e.width, e.height, false);
+}
+
+void Widget::configureHandler(const XConfigureEvent &e)
+{
+ EventHandler::configureHandler(e);
+ if (_ignore_config) {
+ _ignore_config--;
+ } else {
+ if (!(e.width == _rect.width() && e.height == _rect.height())) {
+ _dirty = true;
+ _rect.setSize(e.width, e.height);
+ }
+ update();
+ }
+}
+