[Openmcl-devel] Failing to find constant...

Duncan Rose duncan at robotcat.demon.co.uk
Wed Feb 18 12:25:43 PST 2004


I'm trying to populate a native NSMutableDictionary object with the 
following:

     (ccl::send dict :set-object font :for-key #$NSFontAttributeName)

but I get the following error on compilation:

 > Error in process listener(1): Constant not found: 
OS::|NSFontAttributeName|
 > While executing: CCL::LOAD-OS-CONSTANT
 > Type :GO to continue, :POP to abort.
 > If continued: Skip loading init file.

Other constants can be found - for example:

(logior #$NSTitledWindowMask #$NSClosableWindowMask 
#$NSMiniaturizableWindowMask #$NSResizableWindowMask)

produces the expected results, so I don't suspect the interface files 
at this time.

Hoping that the value of NSFontAttributeName is the same as the 
variable name, I also tried:

     (ccl::send dict :set-object font :for-key #@"NSFontAttributeName")

but the font that is drawn is the default for a string with attributes 
(Helvetica 12pt).

The constants are defined in <AppKit/NSAttributedString.h> (relevent 
excerpt below).

/* Predefined character attributes for text. If the key is not in the 
dictionary, then use the default values as described below.
*/
APPKIT_EXTERN NSString *NSFontAttributeName;             /* NSFont, 
default Helvetica 12 */
APPKIT_EXTERN NSString *NSParagraphStyleAttributeName;   /* 
NSParagraphStyle, default defaultParagraphStyle */
APPKIT_EXTERN NSString *NSForegroundColorAttributeName;  /* NSColor, 
default blackColor */
APPKIT_EXTERN NSString *NSUnderlineStyleAttributeName;   /* int, 
default 0: no underline */
APPKIT_EXTERN NSString *NSSuperscriptAttributeName;      /* int, 
default 0 */
APPKIT_EXTERN NSString *NSBackgroundColorAttributeName;  /* NSColor, 
default nil: no background */

Anybody have any ideas how I can access these values?

Thanks,

-Duncan




More information about the Openmcl-devel mailing list