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

  1. 8 months ago

    Ivan T

    4 Jan 2019 Pre-Release Testers

    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 :-(

    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

  2. Beatrix W

    4 Jan 2019 Pre-Release Testers Europe (Germany)

    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.

  3. Ivan T

    4 Jan 2019 Pre-Release Testers

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

    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.

  4. Beatrix W

    5 Jan 2019 Pre-Release Testers Europe (Germany)

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

    ToolTips do not appear on 64-bit macOS builds.

  5. Christian S

    5 Jan 2019 Pre-Release Testers, Xojo Pro, XDC Speakers Germany

    Check also NSViewTooltipMBS class in our plugins.

  6. @Pedro I;Tellez Corella — On macOS, you can try the following:

    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"
  7. Jean-Yves P

    5 Jan 2019 Pre-Release Testers, Xojo Pro Europe (France, Besançon)

    @Beatrix W Now I'm confused. What are you doing? There is no Tooltip for 64bit macOS:

    ToolTips do not appear on 64-bit macOS builds.

    euh. tooltip is working for me on 64bits macos builds ...

  8. Douglas H

    5 Jan 2019 Pre-Release Testers, Xojo Pro

    @Beatrix W Now I'm confused. What are you doing? There is no Tooltip for 64bit macOS:

    ToolTips do not appear on 64-bit macOS builds.

    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.

  9. Richard W

    5 Jan 2019 Pre-Release Testers, Xojo Pro

    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.

  10. Ivan T

    5 Jan 2019 Pre-Release Testers

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

    Looks Like the ToolTip class is also NOT native in MacOS

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

    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

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

  12. Ivan T

    6 Jan 2019 Pre-Release Testers

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

    Feedback Case #9610

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

    Feedback Case #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

    Feedback Case #54585

    -image-

  13. 7 months ago

    @SubSonics ;.. — I am only aware of this way

  14. 3 months ago

    Dave S

    May 27 San Diego, California USA

    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?

  15. Douglas H

    May 27 Pre-Release Testers, Xojo Pro

    @Dave S Is this something that was "fixed", and the LangRef wasn't updated?
    or what?

    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...

  16. Greg O

    May 27 Xojo Inc

    It was fixed, docs not updated.

  17. Dave S

    May 27 San Diego, California USA

    @Douglas H Yes, but I don't recall which version had the fix..

    @Greg OLone It was fixed, docs not updated.

    Thanks..

  18. Ivan T

    May 27 Pre-Release Testers

    @Greg OLone 54585

    Any plans to fix Feedback Case #54585?

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

or Sign Up to reply!