]> Dogcows Code - chaz/openbox/blobdiff - otk/button.cc
support net_wm_strut's! nothing to do with them yet however
[chaz/openbox] / otk / button.cc
index f080c7699d24d5de5a90f0d113a72cc84de5b85e..9f3930873e20453bc50969c26ed474a28039de7b 100644 (file)
@@ -1,3 +1,9 @@
+// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
+
+#ifdef HAVE_CONFIG_H
+# include "../config.h"
+#endif
+
 #include "button.hh"
 
 namespace otk {
@@ -6,18 +12,24 @@ OtkButton::OtkButton(OtkWidget *parent)
   : OtkFocusLabel(parent), _pressed(false), _pressed_focus_tx(0),
     _pressed_unfocus_tx(0), _unpr_focus_tx(0), _unpr_unfocus_tx(0)
 {
-  setTexture(getStyle()->getButtonFocus());
-  setUnfocusTexture(getStyle()->getButtonUnfocus());
-  _pressed_focus_tx = getStyle()->getButtonPressedFocus();
-  _pressed_unfocus_tx = getStyle()->getButtonPressedUnfocus();
 }
 
 OtkButton::~OtkButton()
 {
-  if (_pressed_focus_tx) delete _pressed_focus_tx;
-  if (_pressed_unfocus_tx) delete _pressed_unfocus_tx;
 }
 
+
+void OtkButton::setStyle(Style *style)
+{
+  OtkFocusLabel::setStyle(style);
+  
+  setTexture(style->getButtonFocus());
+  setUnfocusTexture(style->getButtonUnfocus());
+  _pressed_focus_tx = style->getButtonPressedFocus();
+  _pressed_unfocus_tx = style->getButtonPressedUnfocus();
+}
+
+
 void OtkButton::press(unsigned int mouse_button)
 {
   if (_pressed) return;
@@ -51,18 +63,18 @@ void OtkButton::setUnfocusTexture(BTexture *texture)
   _unpr_unfocus_tx = texture;
 }
 
-int OtkButton::buttonPressHandler(const XButtonEvent &e)
+void OtkButton::buttonPressHandler(const XButtonEvent &e)
 {
   press(e.button);
   update();
-  return OtkFocusWidget::buttonPressHandler(e);
+  OtkFocusWidget::buttonPressHandler(e);
 }
 
-int OtkButton::buttonReleaseHandler(const XButtonEvent &e)
+void OtkButton::buttonReleaseHandler(const XButtonEvent &e)
 {
   release(e.button);
   update();
-  return OtkFocusWidget::buttonReleaseHandler(e);
+  OtkFocusWidget::buttonReleaseHandler(e);
 }
 
 }
This page took 0.026507 seconds and 4 git commands to generate.