]> Dogcows Code - chaz/openbox/blobdiff - otk/button.cc
add an OBBackgroundWidget and use it for setting colors so far.
[chaz/openbox] / otk / button.cc
index f080c7699d24d5de5a90f0d113a72cc84de5b85e..2b17458206432bad0e1d4714c5c939fb40f61395 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,17 +12,23 @@ OtkButton::OtkButton(OtkWidget *parent)
   : OtkFocusLabel(parent), _pressed(false), _pressed_focus_tx(0),
     _pressed_unfocus_tx(0), _unpr_focus_tx(0), _unpr_unfocus_tx(0)
 {
+}
+
+OtkButton::~OtkButton()
+{
+}
+
+
+void OtkButton::setStyle(Style *style)
+{
+  OtkFocusLabel::setStyle(style);
+  
   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::press(unsigned int mouse_button)
 {
@@ -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.023399 seconds and 4 git commands to generate.