]> Dogcows Code - chaz/openbox/commitdiff
add a recursive flags to OtkWidget::show/hide
authorDana Jansens <danakj@orodu.net>
Sun, 1 Dec 2002 10:57:49 +0000 (10:57 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 1 Dec 2002 10:57:49 +0000 (10:57 +0000)
dont delet eshit in the style from button's destructor

otk/button.cc
otk/widget.cc
otk/widget.hh

index 502a226f2d8033362d682ce5d8d9957c8795468a..8dea882e461c41b07405be9f6d4f868a27242882 100644 (file)
@@ -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)
index 79a1f93a4ca2d56597c8bec031eee448dea0978d..61d65fbef7f1c2907347dd5c305c96c9a8bc1051 100644 (file)
@@ -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)
index cc6827cfbd32bdc7b49bbbe9e9becbfd5602e87d..6c122a1d46fc6f3ff3806dc589402385c9495834 100644 (file)
@@ -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);
This page took 0.028702 seconds and 4 git commands to generate.