[vwnc] Passing Smalltalk Object to Cocoa with ObjectiveCRuntime

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] Passing Smalltalk Object to Cocoa with ObjectiveCRuntime

Vladimir Pogorelenko
I do a little wrapper for a tiny Objective-C class using  
ObjectiveCRuntime.
In order to my Cocoa object work properly I need to pass some kind of  
listener object (object containing few action methods) to it.

Please tell me how to pass Smalltalk object as a parameter argument.  
The purpose of smalltalk object is to react on some events. For  
example object looks like:

CocoaListener
        onAction
                self doNothing.

        onAnotherAction
                self doSomething.


I consider something like this:

|cocoaListener|
cocoaListener := CocoaListener new.

ObjectiveCRuntime object: SomeCocoaClassID perform: 'setListener:'  
with: cocoaListener.

But I guess I can't pass cocoaListener to ObjectiveCRuntime. Instead I  
guess I must compose NSObject with given methods dynamically somehow.  
But I don't know how.

Could someone tell me any suggestions how to figure out it?

Thanks,
Vladimir.
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc