… | |
… | |
18 | our $BUTTON_STATE; |
18 | our $BUTTON_STATE; |
19 | |
19 | |
20 | our %WIDGET; # all widgets, weak-referenced |
20 | our %WIDGET; # all widgets, weak-referenced |
21 | |
21 | |
22 | our $TOOLTIP_WATCHER = Event->idle (min => 1/60, cb => sub { |
22 | our $TOOLTIP_WATCHER = Event->idle (min => 1/60, cb => sub { |
23 | return if $ENV{CFPLUS_DEBUG} & 8; |
|
|
24 | |
|
|
25 | if (!$GRAB) { |
23 | if (!$GRAB) { |
26 | for (my $widget = $HOVER; $widget; $widget = $widget->{parent}) { |
24 | for (my $widget = $HOVER; $widget; $widget = $widget->{parent}) { |
27 | if (length $widget->{tooltip}) { |
25 | if (length $widget->{tooltip}) { |
28 | if ($TOOLTIP->{owner} != $widget) { |
26 | if ($TOOLTIP->{owner} != $widget) { |
29 | $TOOLTIP->hide; |
27 | $TOOLTIP->hide; |
30 | |
28 | |
31 | $TOOLTIP->{owner} = $widget; |
29 | $TOOLTIP->{owner} = $widget; |
|
|
30 | |
|
|
31 | return if $ENV{CFPLUS_DEBUG} & 8; |
32 | |
32 | |
33 | my $tip = $widget->{tooltip}; |
33 | my $tip = $widget->{tooltip}; |
34 | |
34 | |
35 | $tip = $tip->($widget) if CODE:: eq ref $tip; |
35 | $tip = $tip->($widget) if CODE:: eq ref $tip; |
36 | |
36 | |