OtkButton::~OtkButton()
{
- if (_pressed_focus_tx) delete _pressed_focus_tx;
- if (_pressed_unfocus_tx) delete _pressed_unfocus_tx;
}
void OtkButton::press(unsigned int mouse_button)
_ignore_config++;
}
-void OtkWidget::show(void)
+void OtkWidget::show(bool recursive)
{
if (_visible)
return;
if (_dirty)
update();
- OtkWidgetList::iterator it = _children.begin(), end = _children.end();
- for (; it != end; ++it)
- (*it)->show();
+ if (recursive) {
+ OtkWidgetList::iterator it = _children.begin(), end = _children.end();
+ for (; it != end; ++it)
+ (*it)->show();
+ }
XMapWindow(otk::OBDisplay::display, _window);
_visible = true;
}
-void OtkWidget::hide(void)
+void OtkWidget::hide(bool recursive)
{
if (! _visible)
return;
- OtkWidgetList::iterator it = _children.begin(), end = _children.end();
- for (; it != end; ++it)
- (*it)->hide();
-
+ if (recursive) {
+ OtkWidgetList::iterator it = _children.begin(), end = _children.end();
+ for (; it != end; ++it)
+ (*it)->hide();
+ }
+
XUnmapWindow(otk::OBDisplay::display, _window);
_visible = false;
}
void OtkWidget::render(void)
{
+ if (!_texture) return;
+
_bg_pixmap = _texture->render(_rect.width(), _rect.height(), _bg_pixmap);
if (_bg_pixmap)
virtual void setGeometry(int x, int y, int width, int height);
inline bool isVisible(void) const { return _visible; };
- virtual void show(void);
- virtual void hide(void);
+ virtual void show(bool recursive = false);
+ virtual void hide(bool recursive = false);
inline bool isFocused(void) const { return _focused; };
virtual void focus(void);