From d07b6f0ecb10d4aa29ac966dd4876d739fc11df3 Mon Sep 17 00:00:00 2001 From: Bill Spitzak Date: Tue, 14 May 2002 15:55:20 +0000 Subject: Another change to tooltips noticed when making the 2.0 version. It appears that Fl::remove_timeout() may be broken in 1.1. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.1@2221 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Tooltip.cxx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index f0ed3a17b..7586a238c 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -1,5 +1,5 @@ // -// "$Id: Fl_Tooltip.cxx,v 1.38.2.21 2002/05/14 15:24:03 spitzak Exp $" +// "$Id: Fl_Tooltip.cxx,v 1.38.2.22 2002/05/14 15:55:20 spitzak Exp $" // // Tooltip source file for the Fast Light Tool Kit (FLTK). // @@ -154,11 +154,11 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) // printf(" recursion=%d, window=%p\n", recursion, window); if (recursion) return; - Fl::remove_timeout(tooltip_timeout); - Fl::remove_timeout(recent_timeout); if (t && *t && enabled()) { // there is a tooltip // do nothing if it is the same: if (wid==widget && x==X && y==Y && w==W && h==H && t==tip) return; + Fl::remove_timeout(tooltip_timeout); + Fl::remove_timeout(recent_timeout); // remember it: widget = wid; X = x; Y = y; W = w; H = h; tip = t; if (recent_tooltip || Fl_Tooltip::delay() < .1) { @@ -174,6 +174,9 @@ Fl_Tooltip::enter_area(Fl_Widget* wid, int x,int y,int w,int h, const char* t) Fl::add_timeout(Fl_Tooltip::delay(), tooltip_timeout); } } else { // no tooltip + if (!tip) return; + Fl::remove_timeout(tooltip_timeout); + Fl::remove_timeout(recent_timeout); tip = 0; widget = 0; if (window) window->hide(); @@ -200,5 +203,5 @@ void Fl_Widget::tooltip(const char *tt) { } // -// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.21 2002/05/14 15:24:03 spitzak Exp $". +// End of "$Id: Fl_Tooltip.cxx,v 1.38.2.22 2002/05/14 15:55:20 spitzak Exp $". // -- cgit v1.2.3