New topic: 

Carbon/Cocoa firing order

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

         Page 1 of 1
   [ 2 posts ]                 Previous topic | Next topic          Author  
Message        julgus_sweden          Post subject: Carbon/Cocoa firing 
orderPosted: Thu Apr 26, 2012 10:46 am                         
Joined: Wed Dec 05, 2007 5:17 am
Posts: 474
Location: Sweden                I have tried to build my apps using Cocoa build 
option. I get NilExceptionError. As I have received since I started to test 
Cocoa. Today I looked deeper into why. I found that a tabpanel.value change 
initiated an event, as it should, but before the parent window open event 
fired? Is this as it should work?

When using Carbon window open event fires, then tabpanel....      
_________________
iMac 27" i7, Macbook 13.3,Macbook PRO 15, Mac mini, iPhone 4s & REALStudio...
http://www.precis-it.se  
                             Top                 timhare          Post subject: 
Re: Carbon/Cocoa firing orderPosted: Thu Apr 26, 2012 3:22 pm                   
      
Joined: Fri Jan 06, 2006 3:21 pm
Posts: 11239
Location: Portland, OR  USA                That is one reason not to rely on 
event order.  The only events you can really rely on are

app.Open fires first
all the control Open events fire next
window.Open fires.
window.Activate *should* fire after window.Open (and fires occasionally 
thereafter as needed).

Events like TabPanel.Change are undefined, so don't count on them.  Also, the 
order that the controls fire their open events is undefined.

To solve your current problem, add a property to the window and check it in 
both TabPanel.Change and Window.Open.  In the scenario where TabPanel.Change 
happens first, you can either perform the window.open code in the tabpanel, or 
perform the tabpanel.change code in window.open.  Depends on what other 
dependencies there are in the code.   
                             Top             Display posts from previous: All 
posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost 
timeSubject AscendingDescending          Page 1 of 1
   [ 2 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