summaryrefslogtreecommitdiff
path: root/otk
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-12-01 10:57:49 +0000
committerDana Jansens <danakj@orodu.net>2002-12-01 10:57:49 +0000
commit4d1a90b0d22927c7a4cba0f347bb39c868204bc6 (patch)
tree56bbece084168664922bc62c25b649c6e3cf283d /otk
parentcb5dfe7cfb2416ac7bf0cedecd27c722c310a0ea (diff)
add a recursive flags to OtkWidget::show/hide
dont delet eshit in the style from button's destructor
Diffstat (limited to 'otk')
-rw-r--r--otk/button.cc2
-rw-r--r--otk/widget.cc24
-rw-r--r--otk/widget.hh4
3 files changed, 17 insertions, 13 deletions
diff --git a/otk/button.cc b/otk/button.cc
index 502a226f..8dea882e 100644
--- a/otk/button.cc
+++ b/otk/button.cc
@@ -20,8 +20,6 @@ OtkButton::OtkButton(OtkWidget *parent)
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)
diff --git a/otk/widget.cc b/otk/widget.cc
index 79a1f93a..61d65fbe 100644
--- a/otk/widget.cc
+++ b/otk/widget.cc
@@ -147,7 +147,7 @@ void OtkWidget::setGeometry(int x, int y, int width, int height)
_ignore_config++;
}
-void OtkWidget::show(void)
+void OtkWidget::show(bool recursive)
{
if (_visible)
return;
@@ -156,23 +156,27 @@ void OtkWidget::show(void)
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;
}
@@ -227,6 +231,8 @@ void OtkWidget::ungrabKeyboard(void)
void OtkWidget::render(void)
{
+ if (!_texture) return;
+
_bg_pixmap = _texture->render(_rect.width(), _rect.height(), _bg_pixmap);
if (_bg_pixmap)
diff --git a/otk/widget.hh b/otk/widget.hh
index cc6827cf..6c122a1d 100644
--- a/otk/widget.hh
+++ b/otk/widget.hh
@@ -60,8 +60,8 @@ public:
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);