No tooltip for control in notebook page under OS X

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
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

No tooltip for control in notebook page under OS X

Post by eranon »

Hello,

Talking about an app built against wxWidgets 3.1.0 (but same w/ 3.0.2) under OS X 10.9, all tooltips about controls in the pages of a notebook (wxNotebook, not wxAuiNotebook) are ignored. Observed in OS X 10.9 and macOS 10.12. So, a matter of events flow for sure, but I don't succeed to figure out a simple way to solve this... Or, rather, the only one "solution" I found sounds more like a "hack"...

The UI tree (reduced for test) is this one below (of course, I don't mention the sizers):

Code: Select all

frame
    panel
        notebook
            page (panel w/ notebook as parent)
                control_with_tooltip (w/ page as parent)
If I change the page's parent as frame, it works, but I have a beautiful assert on launch telling me:
"pPage->GetParent() == this" failed in InsertPage(): notebook pages must have notebook as parent
Anyway, if I ignore the assert, it seems to work (pages are well inserted and initialized), but not sure about pernicious side-effects...

What do you think? What's the regular way to ensure tooltips inside wxNotebook's page?

It works under Windows and worked in an old version of this app under OS X 10.8 built against wxWidgets 2.9 (don't know if the reason of the regression came from OS X or wxWidgets since my current app requires OS X 10.9+).
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: No tooltip for control in notebook page under OS X

Post by ONEEYEMAN »

Hi,
Can you modify a notebook sample so that it has a tooltip capability and then try it with both 3.1 and 2.9 on the same OSX version?

Or even better - try to build the new application with 2.9 and see what happens. And then try to build the new one with 3.1.
Just try to eliminate who is the cause.

Thank you.
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: No tooltip for control in notebook page under OS X

Post by eranon »

Hi ONEEYEMAN, good idea. Well, I don't have wx 2.9 on hand, but I'm going to see in notebook sample against wx 3.1 (still under OS X 10.9)...
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: No tooltip for control in notebook page under OS X

Post by eranon »

Well, maybe a good news (if something wrong in my code is a good news LOL), since it partially works with the notebook sample coming with wxWidgets 3.1.0. Here the details:

GOOD:
It does work in a new page going with the menu "Pages -> Add page". I added a tooltip to the second button (see below) and it directly works:

Code: Select all

wxPanel *MyFrame::CreateNewPage() const
{
    wxPanel *panel = new wxPanel(m_bookCtrl, wxID_ANY );
#if wxUSE_HELP
    panel->SetHelpText( wxT( "Panel with \"First\" and \"Second\" buttons" ) );
#endif
    (void) new wxButton(panel, wxID_ANY, wxT("First button"), wxPoint(10, 30));    

    // START OF CHANGE
    wxButton* pSecondBtn = new wxButton(panel, wxID_ANY, wxT("Second button"), wxPoint(150, 30)); 
    pSecondBtn->SetToolTip("Second button");
    // END OF CHANGE
    
    return panel;
}
MIXED:
It doesn't work directly if I do the same in the "Maximized button" tab with its single button: first, it doesn't work at all (no tooltip) and even if I click on the button itself and/or the page around to be sure about focus, it doesnt give me any tooltip... Until I resize the UI (manually through border or going with the "Pages -> Set page size" command).

--
EDIT: And more funny, it works in my app too once I try to resize the UI (I say "try" since my app is a fixed size one; with locked size)... However, engaging a resize event seem to unlock the tooltip. If I move to another tab, I have to renew the resize attempt to allow tooltip. Well, so not sure, maybe I could generate a resize event on tab change... Weird!
Last edited by eranon on Thu Aug 31, 2017 8:27 pm, edited 1 time in total.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: No tooltip for control in notebook page under OS X

Post by ONEEYEMAN »

Hi,
So then the solution is simple - make the code the same as in the "Added Page".

But just to be curious - can you run this code under the old OSX?

Thank you.
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: No tooltip for control in notebook page under OS X

Post by eranon »

Oh, edited my previous post in the meantime ;) Here it is:

And more funny, it works in my app too once I try to resize the UI (I say "try" since my app is a fixed size one; with locked size)... However, engaging a resize event seem to unlock the tooltip. If I move to another tab, I have to renew the resize attempt to allow tooltip. Well, so not sure, maybe I could generate a resize event on tab change... Weird!

You talk about wx 3.1 sample under OS X 10.8?

--
EDIT: Tried this same notebook.app with tooltip on maximized button (right side tab) in OS X 10.8 Mountain Lion and it directly works (no need to resize).

--
EDIT 2: Same as 10.9 under 10.12 Sierra (no tooltip until resizing).

--
EDIT 3: And finally, same as 10.9 and 10.12 in 10.10 Yosemite. I don't have 10.11 El Capitan on hand, but chance the issue started from 10.9 Mavericks.
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: No tooltip for control in notebook page under OS X

Post by eranon »

OK, solved (or rather bypassed) adding a Fit() for concerned tab in OnChangedTab() handler. This way, all tooltips for this same page are working. Thanks for your idea about sample, Oneeye.

We could summarize by something like "Tooltip doesn't work in notebook pages initialized at early stage of an app in OS X 10.9+". If someone else confirm the same behavior (to eliminate any personal context), I'll fill-in a bug in wxTracker...
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: No tooltip for control in notebook page under OS X

Post by ONEEYEMAN »

Hi,
I think you testing confirm that it is an issue with OSX10.9+, no?

You can try to file a bug with Apple and maybe they will fix it in the next release. Or the next-next one, Or... ;-)

Thank you.
User avatar
eranon
Can't get richer than this
Can't get richer than this
Posts: 867
Joined: Sun May 13, 2012 11:42 pm
Location: France
Contact:

Re: No tooltip for control in notebook page under OS X

Post by eranon »

ONEEYEMAN wrote: You can try to file a bug with Apple and maybe they will fix it in the next release. Or the next-next one, Or... ;-)
Ha ha, I was afraid someone[eye] would have this kind of bad idea ;) Noooo, mercy ](*,)
[Ind. dev. - wxWidgets 3.0/3.1 under "Win 7 64-bit, TDM64-GCC" + "OS X 10.9, LLVM Clang"]
ONEEYEMAN
Part Of The Furniture
Part Of The Furniture
Posts: 7477
Joined: Sat Apr 16, 2005 7:22 am
Location: USA, Ukraine

Re: No tooltip for control in notebook page under OS X

Post by ONEEYEMAN »

;-)
Post Reply