Got stumped :( . I forgot that the class I try to wrap right now is a
singleton. With other words in that case I need to assign a c-pointer
somehow to the class itself not the instance of it. But the class object
is created by smalltalk so I can't mess with it.
No. Even if it is a singleton, *never* place singleton methods on the
class side. Add a #uniqueInstance class method cCall and use
gst_register_oop to ensure that the singleton instance is not garbage
collected.
So basically I need to mess with the STSomething object. Can I do the
same hack you mentioned simply for STSomething like this?
Object subclass: STSomething [
STSomething class [
<shape: #byte>
new [<cCall: 'CSomething_new' returning: #void args: #(#self)> ]
]
]
I answered above, but probably you want "returning: #smalltalk args:
#(#selfSmalltalk)" in general.
Paolo
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk