control transparency with cocoa windows

Hi there… I have this working on windows and on carbon…

I have a tool which is a window in my app (actually a metronome), It has a slider which controls it’s transparency (so you can see thru it to stuff below).
However, my command has no effect in cocoa. any ideas?

[code] dim j as integer
dim k as single
dim i as single

If Me.left + x - DragX1>363 Then
Me.Left=363
Elseif Me.left + x - DragX1<245 Then
Me.Left=245
Else
Me.Left=Me.left + x - DragX1
End if

j=me.left-245
k=8/(363-245)
i=j*k
i=i+2
i=i/10

dim newOpacity as single
newOpacity = max( i, newOpacity )

// set the window’s opacity
self.opacity = newOpacity[/code]

Hum… Could you post the Opacity method ?

Otherwise, here is a method posted originally by Eli Ott which works perfectly in the Open event here :

Declare Sub setAlphaValue Lib "Cocoa" Selector "setAlphaValue:" (NSWindow As Ptr, alphaValue As Single) setAlphaValue(Ptr(Self.Handle), 0.5)

That works a treat! Works for Mac 64 bit as well!