Callbacks (sigh :-)

Alain Fischer mailinglist.fischer at bluewin.ch
Tue Feb 7 20:21:40 UTC 2006


Hi Davide,

First, you must test that the Squeak callback process is running.
You could test that by running the tests in ObjcBridgeTest.
You must have: "16 run, 16 passed, 0 failed, 0 errors".

But I don't think this is the cause of your problem.

Has I read your exemple, "[aSqueakObject description];" will not write  
anything in the Transcript
because "description" is a NSObject message and is sent at the  
Objective-C SqueakProxy and not
forwarded to Squeak.
Try to:
- rename MyObj>>description as MyObj>>myDescription
- in printSomethingTo: send: "[aSqueakObject myDescription];"

Hope this will help you.
Alain


Le 7 févr. 06, à 14:51, Davide Varvello a écrit :

> Hi All,
>  I need again some help from you. The context is always  
> squeak/bluetooth/objective-c, but now I'm trying to reduce the scope  
> to better understand how things are working. So, as probably my  
> problems are coming from asynchronous communication between squeak and  
> objective-c, now I include below two snippets of code:
>
>
> Squeak object with two methods
>
> MyObj >> run
> | bundle delegate |
> bundle _ NSBundle  
> bundleWithPath:'/Users/davide/TransferDelegate/build/ 
> TransferDelegate.framework'.
> bundle load.
>
> delegate _ (bundle classNamed:'TransferDelegate') new.
> delegate printSomethingTo:self.
>
>
> MyObj >> description
> Transcript show:'someone called me'.
>
> ----------------
>
> Objective-c file named TransferDelegate.m
>
>
>
> #import "TransferDelegate.h"
>
>
> @implementation TransferDelegate
>
>
> - (void) printSomethingTo: (NSObject *) aSqueakObject
> {
> 	[aSqueakObject description];
> }
>
>
> @end
> -------------------
>
> Ok, now from squeak I evaluate:
> MyObj new asObjcProxy async run.
>
> and I expect "someone called me" on Transcript, but unfortunately  
> nothing appears.
> I know the method printSomethingTo is called because I added some code  
> to it that prints a string on a file.
> Can you help me to solve this enigma :-) ?
> Thanks
>  Davide
>




More information about the Squeak-dev mailing list