OtkFocusWidget::resize(ft.measureString(_text) + bevel * 2,
ft.height() + bevel * 2);
- ft.drawString(getWindow(), bevel, bevel, *text_color, _text);
OtkFocusWidget::update();
- }
- _dirty = false;
+ ft.drawString(getWindow(), bevel, bevel, *text_color, _text);
+ } else
+ OtkFocusWidget::update();
}
}
std::string _text;
//OtkPixmap _pixmap;
bool _pressed;
- bool _dirty;
+// bool _dirty;
BTexture *_pressed_focus_tx;
BTexture *_pressed_unfocus_tx;
if (XPending(otk::OBDisplay::display)) {
XEvent e;
XNextEvent(otk::OBDisplay::display, &e);
+ if (e.type == Expose)
+ foo.expose(e.xexpose);
}
}
_children.erase(it);
}
+void OtkWidget::expose(const XExposeEvent &e)
+{
+ if (e.window == _window) {
+ _dirty = true;
+ update();
+ } else {
+ OtkWidgetList::iterator it = _children.begin(), end = _children.end();
+ for (; it != end; ++it)
+ (*it)->expose(e);
+ }
+}
+
}
virtual void update(void);
+ void expose(const XExposeEvent &e);
+
inline Window getWindow(void) const { return _window; }
inline const OtkWidget *getParent(void) const { return _parent; }
inline const OtkWidgetList &getChildren(void) const { return _children; }
bool _fixed_width;
bool _fixed_height;
+protected:
bool _dirty;
};