New topic: 

activate problems

<http://forums.realsoftware.com/viewtopic.php?t=41171>

         Page 1 of 1
   [ 4 posts ]                 Previous topic | Next topic          Author  
Message        Art          Post subject: activate problemsPosted: Wed Oct 26, 
2011 11:40 am                         
Joined: Mon Sep 25, 2006 3:25 pm
Posts: 323                I am confused by the difference between Windows and 
Macintosh behavior.  If I click a menu item that calls and starts another 
window in Macintosh the menu item isn't completed until the other window is 
closed.  Because of that .activate is almost never called.  In Windows the menu 
item is completed.  I think but am not sure that Windows is correct.  How do I 
get Mac to complete the menu item?   
                             Top                kermit          Post subject: 
Re: activate problemsPosted: Wed Oct 26, 2011 12:09 pm                         
Joined: Mon May 30, 2011 12:56 am
Posts: 228                The activate event of a window is not the same as the 
menuitem eventhandler.

It is perfectly reasonable that the menu handler does not complete until the 
displayed window is closed, IF the displayed new window is modal.
I often display a modal window to get data, and interrogate the properties of 
that window after it has closed, before it goes out of scope.
If that code is in a manu handler, the handler will not complete until my 
window closes, I read the data, and only then does execution continue to the 
end of the function.

If a window is displayed non-modally, the menu handler should complete 
immediately, because the code has no dependancy on the spawned window.

There is no reason why the activate event should fire at that point.. your new 
window probably has the focus.
Only closing the new window (so that the original one becomes the active one) 
or deliberately clicking on the original window, will cause activate to fire.


I am sure that at some time in the past, even if a window was displayed modal 
to another window, I have seen the parent window reacting to paint events, 
keystrokes and activate events, which in many cases I wouldnt want it to do.
I long ago worked around those issue by some means, so it never hits me now, 
but who knows.. maybe you still see that?   
                             Top                 Art          Post subject: Re: 
activate problemsPosted: Wed Oct 26, 2011 4:16 pm                         
Joined: Mon Sep 25, 2006 3:25 pm
Posts: 323                Thanks. Modal explains Macintosh's behavior.  I 
didn't think it would mean not ending a menuitem, but that explains its 
advantage.  I'll compare it later with Windows behavior.   
                             Top                Art          Post subject: Re: 
activate problemsPosted: Wed Oct 26, 2011 9:46 pm                         
Joined: Mon Sep 25, 2006 3:25 pm
Posts: 323                I check the showmodal problem out.  I changed it to 
just .show and the window went thru the menuitem that it hadn't closed before.  
However, It now hangs when the called window closes out.  It doesn't activate 
the calling window.  I'm not sure how to get that to happen.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 4 posts ]      
-- 
Over 1500 classes with 29000 functions in one REALbasic plug-in collection. 
The Monkeybread Software Realbasic Plugin v9.3. 
http://www.monkeybreadsoftware.de/realbasic/plugins.shtml

[email protected]

Reply via email to