red icon indicating copy to clipboard operation
red copied to clipboard

WISH: Tooltip support in Face

Open JenniferLee520 opened this issue 9 years ago • 6 comments

I hope Face! have a TOOLTIP facet in the future release, as shown below:

btn1: make face! [
    type:    'button
    text:    "Run+Debug"
    tooltip: "Execute in debugging mode"
]

JenniferLee520 avatar Feb 17 '16 06:02 JenniferLee520

We can support that feature, but in face/options block rather.

dockimbel avatar Feb 17 '16 07:02 dockimbel

Still impossible to show a tooltip in Red.

I've tried a few workarounds: all failed miserably.

transparent base to render tooltips: view [button all-over on-over [tip/draw: either event/away? [[]][compose [box (pos: event/offset + 10x10) (pos + 60x20) text (pos) "Hello?"]]] at 0x0 tip: box 200x200]

tooltip as a separate face: view [button all-over on-over [tip/offset: event/offset + 10x10 tip/visible?: not event/away?] tip: base 60x20 white hidden "Hello?"] []

Of course it should be a separate window, as tooltips commonly can stick out of it's parent window, and also should be able to have non-rectangular shape. But that is even more fantastical. Separate window would divert focus from the main one (unacceptable), and transparent windows are not supported.

hiiamboris avatar Mar 16 '22 16:03 hiiamboris

Ah, flickering was because of the offset. With event/offset + 15x15 both workarounds stop flickering. So only limited by window borders then.

hiiamboris avatar Mar 16 '22 16:03 hiiamboris

Theoretically doable on all 3 View backends: Win32, Cocoa, GTK.

9214 avatar Mar 30 '24 12:03 9214