From 948feddc2e0d3c846e1c4669681c475e99540a8b Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 3 Dec 2002 19:01:41 +0000 Subject: [PATCH] update the textures being used on setStyle() calls --- otk/button.cc | 15 ++++++++++++--- otk/button.hh | 2 ++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/otk/button.cc b/otk/button.cc index 8dea882e..fd23a569 100644 --- a/otk/button.cc +++ b/otk/button.cc @@ -12,15 +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) { + setStyle(getStyle()); +} + +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() -{ -} void OtkButton::press(unsigned int mouse_button) { diff --git a/otk/button.hh b/otk/button.hh index a5f93690..2d983fb3 100644 --- a/otk/button.hh +++ b/otk/button.hh @@ -32,6 +32,8 @@ public: void buttonPressHandler(const XButtonEvent &e); void buttonReleaseHandler(const XButtonEvent &e); + void setStyle(Style *style); + private: bool _pressed; -- 2.45.2