wxDialog ShowModal freeze on macOS

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
ppsmurf
In need of some credit
In need of some credit
Posts: 1
Joined: Tue Jan 22, 2019 9:14 am

wxDialog ShowModal freeze on macOS

Post by ppsmurf » Tue Jan 22, 2019 3:25 pm

Hi,
I'm currently developing dynamic library used in other aplication (aplication has no GUI). In my lib I have used IMPLEMENT_APP_NO_MAIN macro. Lib can show few frames and dialogs.
On Windows everything works fine, but on MacOs some dialog freezes (dialog is visible but not responding).
But It freeze only if there is no top window.

PinDialog* dialog = new PinDialog(pinTypeStr);
dialog->ShowModal();

I realy dont know what might be the problem, can anyone help me please?

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

Re: wxDialog ShowModal freeze on macOS

Post by ONEEYEMAN » Tue Jan 22, 2019 7:05 pm

Hi,
Is main application code available?
Where do you create the dialog?
What OSX version are you testing it on?
How did you compile the library?
So if you create a hidden window and make it a parent of the dialog - it works?
Is dialogs sample works for you?

Thank you.

User avatar
cutecode
I live to help wx-kind
I live to help wx-kind
Posts: 198
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: wxDialog ShowModal freeze on macOS

Post by cutecode » Tue Feb 19, 2019 6:05 pm

ppsmurf wrote:
Tue Jan 22, 2019 3:25 pm
Hi,
I'm currently developing dynamic library used in other aplication (aplication has no GUI). In my lib I have used IMPLEMENT_APP_NO_MAIN macro. Lib can show few frames and dialogs.
On Windows everything works fine, but on MacOs some dialog freezes (dialog is visible but not responding).
But It freeze only if there is no top window.

PinDialog* dialog = new PinDialog(pinTypeStr);
dialog->ShowModal();

I realy dont know what might be the problem, can anyone help me please?
did you solve it?
I have the same problem on MAC with wxFrames
The frame shows up only if I click on aplication icon on the tray
regards,
Alexander Saprykin
www.wxwidgets.ru

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

Re: wxDialog ShowModal freeze on macOS

Post by doublemax » Tue Feb 19, 2019 6:07 pm

Did you create an application bundle? Just building is not enough under OSX.

https://wiki.wxwidgets.org/WxMac-specif ... e_front.21
Use the source, Luke!

User avatar
cutecode
I live to help wx-kind
I live to help wx-kind
Posts: 198
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: wxDialog ShowModal freeze on macOS

Post by cutecode » Tue Feb 19, 2019 6:43 pm

doublemax wrote:
Tue Feb 19, 2019 6:07 pm
Did you create an application bundle? Just building is not enough under OSX.

https://wiki.wxwidgets.org/WxMac-specif ... e_front.21
yes I did
I have a folder myApp.App with executeable inside it

The problem is, I have main wxFrame and child wxFrames of the main frame.
The main frame is shown on startup correctly. But child frames are not shown on creation.
They show up only if I click on systemtray icon

What ever I tried doesn't help

Code: Select all

			pFrame->Show();
			pFrame->Raise();
			pFrame->SetFocus();
I use wx 3.1.1
mac 10.14.3
Attachments
1.jpeg
1.jpeg (28.3 KiB) Viewed 54 times
regards,
Alexander Saprykin
www.wxwidgets.ru

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

Re: wxDialog ShowModal freeze on macOS

Post by ONEEYEMAN » Tue Feb 19, 2019 7:05 pm

Hi,
Is you application is MDI-based?

Thank you.

User avatar
cutecode
I live to help wx-kind
I live to help wx-kind
Posts: 198
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: wxDialog ShowModal freeze on macOS

Post by cutecode » Tue Feb 19, 2019 7:25 pm

I tried MDI and wxFrames - the same result on both interfaces
Just added this code to wxApp::OnInt()

Code: Select all

#ifdef __WXOSX__
    ProcessSerialNumber PSN;
    GetCurrentProcess(&PSN);
    TransformProcessType(&PSN,kProcessTransformToForegroundApplication);
#endif
that didn't help either.
regards,
Alexander Saprykin
www.wxwidgets.ru

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

Re: wxDialog ShowModal freeze on macOS

Post by doublemax » Tue Feb 19, 2019 7:43 pm

It should be easy to test if this is a general wxWidgets problem. Modify the minimal sample so that it opens a new frame in MyFrame::OnAbout() instead of showing the version info.
Use the source, Luke!

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

Re: wxDialog ShowModal freeze on macOS

Post by ONEEYEMAN » Tue Feb 19, 2019 7:59 pm

And also, try the docview sample for the MDI.

Thank you.

User avatar
cutecode
I live to help wx-kind
I live to help wx-kind
Posts: 198
Joined: Fri Dec 09, 2016 7:28 am
Contact:

Re: wxDialog ShowModal freeze on macOS

Post by cutecode » Tue Feb 19, 2019 8:24 pm

I tried MDI sample and windows are shown up as expected.

I think problem is that, I use wxAUI inside every wxFrame
I'll try wx 3.1.2 later
regards,
Alexander Saprykin
www.wxwidgets.ru

Post Reply