popup wxPopupTransientWindow with wxDialog as parent 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
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

popup wxPopupTransientWindow with wxDialog as parent on Mac

Post by Anil8753 »

I have a modal wxDialogBox with a push button. On click on this push button, I am launching a wxPopupTransientWindow. This wxPopupTransientWindow has some controls like wxTextCtrl and wxButton.

This is working perfectly under MSW, on Mac on button click wxPopupTransientWindow is get popups but wxPopupTransientWindow is not accessible. wxDialogBox blocks the wxPopupTransientWindow as it is the modal dialog.

I do know how can I make wxPopupTransientWindow accessible?
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Re: popup wxPopupTransientWindow with wxDialog as parent on Mac

Post by Anil8753 »

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

Re: popup wxPopupTransientWindow with wxDialog as parent on Mac

Post by doublemax »

I can't test this as i don't work under OSX. But if it works under Windows, you could try opening a ticket for it: http://trac.wxwidgets.org
Use the source, Luke!
Anil8753
Experienced Solver
Experienced Solver
Posts: 93
Joined: Sat Jan 16, 2016 5:57 am
Location: India

Re: popup wxPopupTransientWindow with wxDialog as parent on Mac

Post by Anil8753 »

This bug is already reported (http://trac.wxwidgets.org/ticket/17406)

After reading the description, I came to know that if I create wxPopupWindow/wxPopupTransientWindow into modal wxDialog constructor, then wxDialog is added as it's parent. So do not create wxPopupWIndow in modal wxDialog constructor.

I found 2 ways to deal with issue:

1. Do not create in wxDialog constructor. Create wxPopupWindow when you need it (i.e. on mouse hover, button click etc.)

2. If want to create one time in constructor and use it later many time, use CallAfter to create it. CallAfter will schedule wxPopupWindow creation for next round after constructor call finishes.

I know this is not a good fix, but this is what I found as immediate solution.
Post Reply