diff options
author | corvid <corvid@lavabit.com> | 2010-04-22 02:18:59 +0000 |
---|---|---|
committer | corvid <corvid@lavabit.com> | 2010-04-22 02:18:59 +0000 |
commit | 14d5a0ab9bec6fd00b0f945ca7738aa4a410be6f (patch) | |
tree | ddb705a66d7ba67ac082652b7b5e66854da59532 /dw/fltkplatform.cc | |
parent | 058a4701d0bef09d21658923e0b4a30e12643b8e (diff) |
use belowmouse() as fltk::Widget for tooltips
Diffstat (limited to 'dw/fltkplatform.cc')
-rw-r--r-- | dw/fltkplatform.cc | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/dw/fltkplatform.cc b/dw/fltkplatform.cc index b9aa6bd8..97e10710 100644 --- a/dw/fltkplatform.cc +++ b/dw/fltkplatform.cc @@ -152,13 +152,8 @@ FltkColor * FltkColor::create (int col) return color; } -::fltk::Widget *FltkTooltip::widget = NULL; - FltkTooltip::FltkTooltip (const char *text) : Tooltip(text) { - /* ::fltk::Tooltip really, really wants a Widget */ - if (!widget) - widget = new ::fltk::InvisibleBox(1, 1, 0, 0, NULL); shown = false; if (!text || !strpbrk(text, "&@")) { @@ -197,9 +192,10 @@ FltkTooltip *FltkTooltip::create (const char *text) void FltkTooltip::onEnter() { - Rectangle rect; - widget->get_absolute_rect(&rect); - ::fltk::Tooltip::enter(widget, rect, escaped_str ? escaped_str : str); + fltk::Widget *widget = fltk::belowmouse(); + + ::fltk::Tooltip::enter(widget, *((fltk::Rectangle *)widget), + escaped_str ? escaped_str : str); shown = true; } |