From f93978aba486bf0fea8d9ee857d014a02f3f7d96 Mon Sep 17 00:00:00 2001 From: maxim nikonov Date: Fri, 6 Feb 2026 03:39:53 +0500 Subject: wi[ --- src/Fl_Tooltip.cxx | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'src/Fl_Tooltip.cxx') diff --git a/src/Fl_Tooltip.cxx b/src/Fl_Tooltip.cxx index 62c2f5ea1..cb85f520e 100644 --- a/src/Fl_Tooltip.cxx +++ b/src/Fl_Tooltip.cxx @@ -41,7 +41,7 @@ int Fl_Tooltip::margin_width_ = 3; int Fl_Tooltip::margin_height_ = 3; int Fl_Tooltip::wrap_width_ = 400; const int Fl_Tooltip::draw_symbols_ = 1; -char *Fl_Tooltip::override_text_ = 0; +char *Fl_Tooltip::_text_ = 0; static const char* tip; @@ -163,10 +163,10 @@ static void tooltip_hide_timeout(void*) { When FLTK sends an FL_BEFORE_TOOLTIP event to the widget under the mouse pointer, you can handle this event to modify the tooltip text dynamically. - The provided text will be copied into a local buffer. To apply the override, + The provided text will be copied into a local buffer. To apply the , the event handler must return 1. - To disable the tooltip for the current event, set the override text to 0 + To disable the tooltip for the current event, set the text to 0 or an empty string ("") and return 1. \param[in] new_text a C string that will be copied into a buffer @@ -176,15 +176,15 @@ static void tooltip_hide_timeout(void*) { \see `test/color_chooser.cxx` for a usage example. */ -int Fl_Tooltip::override_text(const char *new_text) { - if (new_text != override_text_) { - if (window && window->label()==override_text_) +int Fl_Tooltip::_text(const char *new_text) { + if (new_text != _text_) { + if (window && window->label()==_text_) ((Fl_Widget *) window)->label(0); - if (override_text_) - ::free(override_text_); - override_text_ = 0; + if (_text_) + ::free(_text_); + _text_ = 0; if (new_text) - override_text_ = fl_strdup(new_text); + _text_ = fl_strdup(new_text); } return 1; } @@ -199,7 +199,7 @@ void Fl_Tooltip::tooltip_timeout_(void*) { if (!top_win_iconified_()) { // no tooltip if top win iconified (STR #3157) if (Fl_Tooltip::current()) { if (Fl_Tooltip::current()->handle(FL_BEFORE_TOOLTIP)) - tip = Fl_Tooltip::override_text_; + tip = Fl_Tooltip::_text_; } if (!tip || !*tip) { if (window) window->hide(); @@ -395,8 +395,8 @@ void Fl_Tooltip::set_enter_exit_once_() { Tooltips can be updated dynamically before they are displayed. When a tooltip is about to be shown, FLTK sends an `FL_BEFORE_TOOLTIP` event to the widget’s - `handle()` method. Developers can override the tooltip text temporarily - using `Fl_Tooltip::override_text(const char* new_text)` and returning 1 from + `handle()` method. Developers can the tooltip text temporarily + using `Fl_Tooltip::_text(const char* new_text)` and returning 1 from `handle()` to apply the change. \param[in] text New tooltip text (no copy is made) -- cgit v1.2.3