On Nov 22, 2006, at 7:18 PM, Karen wrote:
On Nov 22, 2006, at 7:12 PM, Charles Yeomans wrote:
Here is some old code. You can find the theme brush constants in
the MacOS Appearance Manager docs -- I think.
Charles Yeomans
Function ThemeColor(brush as Integer) As Color
dim colorPtr as MemoryBlock
dim OSErr as Integer
Const depth = 32
#if TargetCarbon
Declare Function GetThemeBrushAsColor Lib "CarbonLib" (inColor
as Integer, inDepth as Short, inColorDev as Boolean, outColor as
Ptr) as Integer
#endif
#if TargetPPC
Declare Function GetThemeBrushAsColor Lib
"AppearanceLib" (inColor as Integer, inDepth as Short, inColorDev
as Boolean, outColor as Ptr) as Integer
#endif
colorPtr = NewMemoryBlock(6)
OSErr = GetThemeBrushAsColor(brush, depth, true, colorPtr)
If OSErr <> 0 then
End if
Return RGB(colorPtr.UShort(0)\257, colorPtr.UShort(2)\257,
colorPtr.UShort(4)\257)
End Function
Thanks!
Will the carbon declare work in a MachO builds too?
Use this.
Soft Declare Function GetThemeBrushAsColor Lib
"Carbon.framework" (inColor as Integer, inDepth as Short, inColorDev
as Boolean, outColor as Ptr) as Integer
This should work in both Carbon Mach-O and PEF builds.
Charles Yeomans
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>