Tooltip not working on Mac

Do you have a typical platform dependent issue you're battling with ? Ask it here. Make sure you mention your platform, compiler, and wxWidgets version.
Post Reply
deepti
Experienced Solver
Experienced Solver
Posts: 88
Joined: Tue Jul 17, 2018 5:38 pm

Tool-tip not working on Mac

Post by deepti » Mon Aug 27, 2018 10:34 am

Hi All,

I have this piece of code. The tool-tip is seen perfectly on Windows, but it just does not show up on Mac.. Please help!

Code: Select all

wxStaticBitmap* infoBmp = new wxStaticBitmap(win, wxID_STATIC, wxBitmap("./info.png", wxBITMAP_TYPE_PNG), wxDefaultPosition, wxSize(16, 16), 0);

infoBmp->SetToolTip(str);

ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 3265
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: Tooltip not working on Mac

Post by ONEEYEMAN » Mon Aug 27, 2018 4:33 pm

Hi,
Usual stanza:

1. Version of wx?
2. Version of OS?
3. How wx was configured (exact line)?
4. I presume it is reproducible in a sample?

Thank you.

deepti
Experienced Solver
Experienced Solver
Posts: 88
Joined: Tue Jul 17, 2018 5:38 pm

Re: Tooltip not working on Mac

Post by deepti » Mon Aug 27, 2018 5:40 pm

Hi,

Thanks for your reply.

1. wx version is 3.1.0
2. OS is Mac High Sierra 10.12
3. wx was configured using the following command:

./configure --disable-shared --enable-unicode --with-libjpeg=builtin --with-libpng=builtin --with-cocoa CXXFLAGS="-std=c++11 -stdlib=libc++ " OBJCXXFLAGS="-std=c++11 -stdlib=libc++" LDFLAGS="-stdlib=libc++"

4. The following is the exact code which is failing only on Mac.

Code: Select all

wxStaticBitmap* infoBmp = new wxStaticBitmap(win, wxID_STATIC, wxBitmap("./info.png", wxBITMAP_TYPE_PNG), wxDefaultPosition, wxSize(16, 16), 0);
infoBmp->SetToolTip(str);

User avatar
doublemax
Moderator
Moderator
Posts: 13575
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Tooltip not working on Mac

Post by doublemax » Mon Aug 27, 2018 6:47 pm

Just for the record: From a GUI point of view, it doesn't make sense for a static bitmap to have a tooltip. A tooltip describes the function of a gui element, i.e. what happens when you click on it.

As a workaround, you could try to use wxGenericStaticBitmap instead.
Use the source, Luke!

deepti
Experienced Solver
Experienced Solver
Posts: 88
Joined: Tue Jul 17, 2018 5:38 pm

Re: Tooltip not working on Mac

Post by deepti » Tue Aug 28, 2018 5:30 am

So, it is actually an Information icon, which when hovered over, will provide more info about the control it is associated with.

The wxGenericStaticBitmap also didn't work - tool-tips are not shown still.
Anything else I could try? This is important, and the usage cannot be changed since that is how it is does in the browser version of the app, and i need to replicate the same behavior in the desktop app.

User avatar
doublemax
Moderator
Moderator
Posts: 13575
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Tooltip not working on Mac

Post by doublemax » Tue Aug 28, 2018 11:25 am

I can't test under OSX. First you should try to find out if this is a OS limitation or a bug in wxWidgets. If it's a bug, please open a ticket at http://trac.wxwidgets.org

Otherwise, you'd have to write something yourself, e.g. based on wxRichToolTip:
http://docs.wxwidgets.org/trunk/classwx ... l_tip.html
Use the source, Luke!

Post Reply