Xojo's not entirely to blame here, the CueText property or "placeHolder" uses an NSAttributedString. There is no actual property for setting the CueText color (that I'm aware of).
The following code uses ma huge azz library (which I can't share right at this moment), but the code it'self should give you an idea of what's needed to change the color of the CueText. Oh and the application will crash if you use this when there isn't a CueText already set.
How to get the CueText color.
declare function getValue lib AppKit selector "placeholderTextColor" ( NSColorClass as integer ) as integer
How to set it on a TextField.
Public Sub placeholderTextColor(extends inField as TextField, assigns inColor as color)
#if targetMacOS then
// --- First we grab some settings from the TextField.
// We need to create a NSFont, so we'll need the font name and font size.
// Sam Rowlands, Nov 2018
Dim fontName as string = inField.textFont
Dim fontSize as single = inField.textSize
if fontName = "SmallSystem" then // --- We want the smallSystem font.
if fontSize = 0 then fontSize = NSFontSmallSystemFontSize( NSFontClass )
fontName = "System"
elseif fontSize = 0 then
fontSize = NSFontSystemFontSize( NSFontClass )
// --- Now we can create a NSFont
Dim theFont as integer
if fontName = "System" or fontName = "" then
theFont = NSFontSystemFontOfSize( NSFontClass, fontSize, NSFontWeight( NSFontWeightRegular ) )
theFont = NSFontWithName( NSFontClass, fontName, fontSize )
// --- Now we can create a NSColor
Dim theColor as integer = NSColor( inColor )
// --- We create an "string attributes" dictionary.
Dim attribs as integer = NSDictionaryWithObjectsForKeys( theFont : "NSFont", theColor : "NSColor" )
// --- We create an attributed string.
Dim attribString as integer = NSAttributedStringWithAttributes( inField.cueText, attribs )
// --- FInally we set that onto the text field.
declare sub setValue lib "AppKit" selector "setPlaceholderAttributedString:" ( NSTextFieldCellInstance as integer, NSAttributedStringInstance as integer )
setValue( NSCellFromNSControl( inField.handle ), attribString )
Hope that this helps.