OK, I figured out what was causing the problem. The symptom was that MacWise would launch in OS 9 when in fact it is an OS X application. This would only happen on the older OS 10.2.8 It would put up an error dialog box telling you that it needed SetWindowAlpha (which lead me on a wild goose chase). In fact the real problem was caused by the plist resource in MacWise. It had the following statement in it: <key>LSRequiresClassic</key> <false/> That statement is somehow misinterpreted by OS 10.2.8 as true instead of false and thinks it wants to open the app in Classic mode. I removed that statement and all is well now. On Apr 12, 2006, at 10:35 AM, Jay Reeve wrote: > Rich, > > You are trying to affect a compile using a runtime conditional. The > compile is obviously completed BEFORE runtime. > > Go ahead and compile the toolbox, but don't call it unless you're > in a system that permits it. Use a global var rather than a > constant to determine whether to call the fn. > > hth, > e-e > =J= a y > " > > toolbox SetWindowAlpha( WindowRef inWindow, double inAlpha ) > > long if ( system( _sysVers ) > 1100) > gTransparentWindowsOK = 1 > end if > > long if gTransparentWindowsOK > SetWindowAlpha( myWindowRef, myAlpha ) > end if > > On Apr 12, 2006, at 8:48 AM, Rich Love wrote: > >> How the heck do I do this then without using a constant? >> #if and #endif only seem to be happy with constants. >> >> If I try the following using the variable xxx , I get a End of >> Statement Expected error >> >> long if ( system( _sysVers ) > 1100) >> TransparentWindowsOK = 1 >> end if >> >> #if TransparentWindowsOK >> toolbox SetWindowAlpha( WindowRef inWindow, double inAlpha ) >> #endif >> >> Rich >> >> >> >> >> On Apr 11, 2006, at 11:26 PM, Brian Stevens wrote: >> >>> Rich, >>> >>> Your code to set a constant does not execute as you might >>> expect. Constants can be set but not changed based on a >>> condition (such as the system version check done). The following >>> code illustrates the point: >>> >>> long if ( system( _sysVers ) > 1100) >>> _TransparentWindowsOK = 1 >>> end if >>> >>> print _TransparentWindowsOK >>> >>> do >>> handleevents >>> until 0 >>> >>> Clearly this long if will NOT be true (because there is no sysem >>> 1100 yet), but you will notice the value is still set to 1. That >>> is because the constant is set regardless of the long if test >>> result. Constants are global and can't be changed(hence the >>> name constants). You might want to use a variable since a >>> constant won't work for the use shown here. >>> >>> The other thing tripping you up is an apparent typo on the >>> conditional compile statements (#if / #endif). Both are testing >>> for a value of 1 in the constant. >>> >>> HTH----Brian >>> >>> >>> >>> On Apr 11, 2006, at 8:55 PM, Rich Love wrote: >>> >>>> >>>> I use transparent windows in MacWise and just discovered that >>>> they do not work with the older Mac OS 10.2.8 >>>> So I am trying to look at the system version and only use >>>> SetWindowAlpha if the OS is newer than 10.2.8 >>>> I thought the following routine would work but when run under OS >>>> 10.2.8, it is still trying to use SetWindowAlpha and opens a >>>> dialog box in OS 9 saying that SetWindowAlpha is not available. >>>> >>>> >>>> I can't figure out why the following does not work under OS 10.2.8 >>>> It is happy as can be under OS 10.4.6 >>>> >>>> >>>> TransParentValue = 3 >>>> >>>> long if ( system( _sysVers ) > 1028) >>>> _TransparentWindowsOK = 1 >>>> end if >>>> >>>> #if _TransparentWindowsOK = 1 >>>> toolbox SetWindowAlpha( WindowRef inWindow, double inAlpha ) >>>> #endif >>>> >>>> >>>> #if _TransparentWindowsOK = 1 >>>> call SetWindowAlpha( TransparentWindow, TransParentValue * .01) >>>> #endif >>>> >>>> >>>> >>>> >>>> Rich >>>> >>>> -- >>>> >>> >>> -- >>> >>> >> >> -- >> > > -- > >