Focus not getting refreshed after wxExecute

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
starightcircle
Earned a small fee
Earned a small fee
Posts: 12
Joined: Fri Sep 11, 2015 6:24 am

Focus not getting refreshed after wxExecute

Post by starightcircle »

I have custom button in my application and it colour will be modified if click on that. This works fine if a launch some dialog on click of a button
but the button does not loose focus after closing the application launched using wxExecute on click of that button.

This problem persists only in mac not on windows. Right after closing the application. say if a pop a message box button focus will be gone which is what is desired. Anyone know what I might be missing here ? wxExecute is used with wxEXEC_SYNC parameter here
User avatar
doublemax
Moderator
Moderator
Posts: 19162
Joined: Fri Apr 21, 2006 8:03 pm
Location: $FCE2

Re: Focus not getting refreshed after wxExecute

Post by doublemax »

It's a little but unclear to me what the problem is.

I guess you're using wxEVT_ENTER_WINDOW and wxEVT_LEAVE_WINDOW to change the look of the button, but you don't receive a wxEVT_LEAVE_WINDOW when you launch another application?

In that case i would just add another method to the button that checks the mouse-over status again and sets its internal status back to the correct value.
Use the source, Luke!
starightcircle
Earned a small fee
Earned a small fee
Posts: 12
Joined: Fri Sep 11, 2015 6:24 am

Re: Focus not getting refreshed after wxExecute

Post by starightcircle »

Thats right double max, The custom button is using EVT_ENTER_WINDOW and EVT_LEAVE_WINDOW. Now i understood what the problem,but did not understand the solution part of your answer.

After the button focus goes the application launched and when that application is closed, Should we check the button status in the new method and reset button to normal state as like before the mouse hover?
Post Reply