From 1111861bd245d23613446d09fc299b0e15bfd42a Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 14 Sep 2003 09:50:01 +0000 Subject: less flicker --- src/FbTk/TextButton.cc | 17 ++++++++++++----- src/FbTk/TextButton.hh | 4 +++- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/FbTk/TextButton.cc b/src/FbTk/TextButton.cc index a9a867f..4b2d45e 100644 --- a/src/FbTk/TextButton.cc +++ b/src/FbTk/TextButton.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: TextButton.cc,v 1.2 2003/09/10 21:36:37 fluxgen Exp $ +// $Id: TextButton.cc,v 1.3 2003/09/14 09:50:01 fluxgen Exp $ #include "TextButton.hh" #include "Font.hh" @@ -86,7 +86,6 @@ void TextButton::clear() { void TextButton::clearArea(int x, int y, unsigned int width, unsigned int height, bool exposure) { - if (backgroundPixmap() != ParentRelative) { if (backgroundPixmap()) { @@ -106,13 +105,17 @@ void TextButton::clearArea(int x, int y, drawText(); - FbWindow::setBackgroundPixmap(m_buffer.drawable()); - - Button::clearArea(x, y, width, height, exposure); + setBufferPixmap(m_buffer.drawable()); + FbWindow::setBackgroundPixmap(m_buffer.drawable()); + updateTransparent(x, y, width, height); + FbWindow::clearArea(x, y, width, height, exposure); + } else { // parent relative + FbWindow::setBufferPixmap(0); FbWindow::setBackgroundPixmap(backgroundPixmap()); Button::clearArea(x, y, width, height, exposure); + updateTransparent(x, y, width, height); drawText(); } @@ -144,4 +147,8 @@ void TextButton::drawText(int x_offset, int y_offset) { align_x + x_offset, center_pos + y_offset); // position } +void TextButton::exposeEvent(XExposeEvent &event) { + clearArea(event.x, event.y, event.width, event.height, false); +} + }; // end namespace FbTk diff --git a/src/FbTk/TextButton.hh b/src/FbTk/TextButton.hh index 5d87804..246461b 100644 --- a/src/FbTk/TextButton.hh +++ b/src/FbTk/TextButton.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: TextButton.hh,v 1.2 2003/09/10 21:36:37 fluxgen Exp $ +// $Id: TextButton.hh,v 1.3 2003/09/14 09:50:01 fluxgen Exp $ #ifndef FBTK_TEXTBUTTON_HH #define FBTK_TEXTBUTTON_HH @@ -56,6 +56,8 @@ public: unsigned int width, unsigned int height, bool exposure = false); + void exposeEvent(XExposeEvent &event); + inline FbTk::Justify justify() const { return m_justify; } inline const std::string &text() const { return m_text; } inline const FbTk::Font &font() const { return *m_font; } -- cgit v0.11.2