+void Widget::setStyle(RenderStyle *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 {
+ int width = e.width;
+ int height = e.height;
+
+ XEvent ev;
+ while (XCheckTypedWindowEvent(**display, _window, ConfigureNotify, &ev)) {
+ width = ev.xconfigure.width;
+ height = ev.xconfigure.height;
+ }
+
+ if (!(width == _rect.width() && height == _rect.height())) {
+ _dirty = true;
+ _rect.setSize(width, height);
+ }
+ update();
+ }
+}
+