widget update fix
Marius Nita marius@cs.pdx.edu
2 files changed,
8 insertions(+),
3 deletions(-)
M
otk/widget.cc
→
otk/widget.cc
@@ -262,7 +262,7 @@ int str_width = _rect.width() - width / stretchable.size();
for (; str_it != str_end; ++str_it) { (*str_it)->setWidth(str_width - _bevel_width); - (*str_it)->update(); + //(*str_it)->update(); } }@@ -317,7 +317,7 @@ int str_height = _rect.height() - height / stretchable.size();
for (; str_it != str_end; ++str_it) { (*str_it)->setHeight(str_height - _bevel_width); - (*str_it)->update(); + //(*str_it)->update(); } }@@ -343,11 +343,16 @@ }
void OtkWidget::update(void) { + OtkWidgetList::iterator it = _children.begin(), end = _children.end(); + for (; it != end; ++it) + (*it)->update(); + if (_dirty) { adjust(); render(); XClearWindow(OBDisplay::display, _window); } + _dirty = false; }
M
otk/widget.hh
→
otk/widget.hh
@@ -25,7 +25,7 @@ Cursor cursor = 0, int bevel_width = 1);
virtual ~OtkWidget(); - void update(void); + virtual void update(void); inline Window getWindow(void) const { return _window; } inline const OtkWidget *getParent(void) const { return _parent; }