Mindphaser is right. My code example runs only with the Carbon framework. At the time of my posting the only available framework was Carbon. With PB 5.00 the default framework changed to Cocoa. So to run my above code example you have to use PB 5.11 or older. In PB 5.00 to 5.11 you have to set the "Library Subsystem:" to "Carbon" in "Compiler/Compiler options...". In PB 4.61 or older the code example runs without anything to change (even on OS X 10.9.2 Mavericks).
Beginning with PB 5.20 the subsystem Carbon was removed...
For your conveniance I have ported the code example to Cocoa:
Code: Select all
Define Alpha.CGFloat
OpenWindow(0, 200, 100, 300, 60, "Change window's transparency")
TrackBarGadget(0, 10, 10, 280, 20, 0, 100)
SetGadgetState(0, 0)
TextGadget(1, 15, 35, 40, 20, "0%")
TextGadget(2, 260, 35, 40, 20, "100%")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Break
Case #PB_Event_Gadget
If EventGadget() = 0
Alpha = 1.0 - GetGadgetState(0) / 100.0
CocoaMessage(0, WindowID(0), "setAlphaValue:@", @Alpha)
EndIf
EndSelect
ForEver