Re: [MacRuby-devel] Using a context with addObserver

2010-05-18 Thread Laurent Sansonetti
Hi Dave, I see. If this pattern is used inside the Apple Sketch sample (so, in source code you control and not in a framework), then indeed passing a unique Pointer instance should do the trick. There are probably better ways to do what you want without using the context argument, once you are

Re: [MacRuby-devel] Using a context with addObserver

2010-05-18 Thread Dave Baldwin
Hi Laurent, I am converting the Apple Sketch sample app to macruby and this construct is used everywhere. My understanding (maybe faulty) is all they are trying to do is generate a unique pointer - pointing at a unique static string should do this, and by assigning it to a constant will show u

Re: [MacRuby-devel] Using a context with addObserver

2010-05-18 Thread Laurent Sansonetti
Hi Dave, Sorry for the late reply. I'm afraid it's not currently possible to pass a string as an API that accepts a 'void *' (which seems to be your case). If you file a ticket on the tracker we can address this problem. Your Pointer.new call may not raise a runtime exception but I suspect it'

Re: [MacRuby-devel] Using a context with addObserver

2010-05-17 Thread Dave Baldwin
Digging a bit more I think a solution to my own questions is: On 13 May 2010, at 14:33, Dave Baldwin wrote: > I am trying to translate code that looks like this: > > static NSString *SKTWindowControllerCanvasSizeObservationContext = > @"com.apple.SKTWindowController.canvasSize"; > > and later