The ToolTip Class is NOT native, How to add a native ToolTip to a window

All we know controls cant be overlaped in Xojo. So, to create some functionality, some controls have to be created in another window. In my case, a little window, with no other controls and the interface drawn in the paint event.

All works great, but, it needs a ToolTip, but the window clas has no HelpTag property :frowning:

The xojo way, Use the ToolTip Class, No problem, MouseEnter -> Show and it closes automatically BUT wait, it colses in 1 second, no way someone is going to read it in that time, ok, that part its broken, lets try with autoHide = False, and a MouseExit -> Hide. It wworks but, what is that, not a ToolTip, just a plain ugly yellow window. no animation, no the system color, no way to blend in with the rest of the interface.

Is any other way to add a native ToolTip to a window?

Is the ToolTip clas NOT native in MacOS and Linux?

Thanks

What are you doing to make the tooltip disappear after a second? Have never seen this.

I have been using attached windows (MAAttachedWindowMBS) for the last years. The main problem was that the MouseExit event didn’t always fire. Show an attached window, change to another app, move the mouse there and when you go by to the Xojo app the MouseExit never fires.

Therefore, I’m going back to a status area help.

In the call of ToolTip.Show Just leave the default value autoHide = True. The tool tip disapears in about 1 or 2 seconds, It is useles, there is no way to set a autoHide behavior with more time.

Now I’m confused. What are you doing? There is no Tooltip for 64bit macOS:

ToolTips do not appear on 64-bit macOS builds.

Check also NSViewTooltipMBS class in our plugins.

@Pedro Ivan Tellez Corella — On macOS, you can try the following:

[code]declare sub setToolTip lib “Cocoa.framework” selector “setToolTip:” (id as integer, text as CFStringRef)

dim rc as RectControl //<< set rc to the control you want
setToolTip rc.Handle, “This is the tooltip to display”[/code]

[quote=420273:@Beatrix Willius]Now I’m confused. What are you doing? There is no Tooltip for 64bit macOS:

ToolTips do not appear on 64-bit macOS builds.[/quote]
euh. tooltip is working for me on 64bits macos builds 


[quote=420273:@Beatrix Willius]Now I’m confused. What are you doing? There is no Tooltip for 64bit macOS:

ToolTips do not appear on 64-bit macOS builds.[/quote]

That depends on your Xojo version. Early 64-bit ones worked if you reversed the sign on the y axis value. In essence, the y = 0 was the bottom of the screen instead of the top. That got fixed later, and now y must be given as a positive offset. I don’t recall exactly when it was fixed. IIRC, up to 2017R3 you used a negative y for 64 bit macOS builds.

If you need to share a common class or module across Xojo versions, you can use #If statements to decide when to reverse the y axis value.

Also, it looks like ToolTip does not support dark mode yet in macOS Mojave. HelpTag does.

Could you place a transparent canvas as a background on the window? I think it can have a HelpTag.

Looks Like the ToolTip class is also NOT native in MacOS

Yes the canvas have a HelpTag. I think this is the only work around, maybe draw all in the canvas instead of the window. Thanks

Is there actually a possibility to adjust the time for macOS tooltips?

It looks like the ToolTip Clas has being broken for more than a decade :frowning:

<https://xojo.com/issue/9610>

I create a new Feature Request to add the HelpTag property to the window class:

<https://xojo.com/issue/54585>

And Also a Bug Report for the ToolTip Class:

-Use the current system theme colors
-Use a shadow if the sistem has one
-Automaticaly wordwrap the text
-Add more time for the autoHide

<https://xojo.com/issue/54585>

@SubSonics 
 — I am only aware of this way

more confusion.
The LangRef says the “Tooltips do not appear on 64-bit macOS Builds”

yet I just compiled a test app in Xojo2019r1 and they do seem to work

Is this something that was “fixed”, and the LangRef wasn’t updated?
or what?

[quote=438528:@Dave S]Is this something that was “fixed”, and the LangRef wasn’t updated?
or what?[/quote]

Yes, but I don’t recall which version had the fix. And before that, someone discovered the Y offset was negative instead of positive so in the broken versions you could still make it work by reversing the sign on the Y coordinate. Or that’s how I recall it anyway. It’s in the forums somewhere


It was fixed, docs not updated.

Thanks


Any plans to fix <https://xojo.com/issue/54585>?

If xojo cant do it native, at least line breaks and the native color will make it usable.