Hello Christian,

I am beginning to experiment with the NSAppleEventHandlerMBS class so that I 
can more easily support a suspending of events that will take a while to 
process. I’ve started very simply just redirecting one of my existing verbs 
over to the new handler. 

I’ve got a subclass of NSAppleEventHandlerMBS called “myNSAppleEventHandlerMBS” 
with an event for handleAppleEvent that just writes a single line to my logfile 
that says it got the event, it’s not trying to do anything with it.

I create a new instance of it in app.Open immediately after initializing the 
plugins and place it into a global variable in a module like:

gMyNSAppleEventHandlerMBS = new myNSAppleEventHandler

I create a new event manager and assign it to the handler like:

dim myDelayHandler as new NSAppleEventManagerMBS
myDelayHandler.setEventHandler( gMyNSAppleEventHandlerMBS, “xten”, “Dely”)

I’ve discovered that I must return false in the Xojo HandleAppleEvent event for 
those parameters or it’s not called, and I’ve added a log line there too so I 
can see that the event if being received by the app and that I’m properly 
returning false from the xojo handler.

It works once, or maybe a couple of times, and then it stops getting the event. 
The event continues to be received by the global xojo handler, and I continue 
to return false from it so that it should fall through to the other handler, 
but the other handler never receives an event.

Do I need to keep a reference to the myDelayHandler as NSAppleEventManagerMBS 
that I create above too? The example program doesn’t do that with the GURL 
handler and it keeps working, I can’t see what I’m doing differently.


Thanks,
 James


James Sentman                       http://www.PlanetaryGear.org                
http://MacHomeAutomation.com




_______________________________________________
Mbsplugins_monkeybreadsoftware.info mailing list
[email protected]
https://ml01.ispgateway.de/mailman/listinfo/mbsplugins_monkeybreadsoftware.info

Reply via email to