[Openmcl-devel] Mid-course correction
R. Matthew Emerson
rme at clozure.com
Mon Nov 5 14:24:15 PST 2007
On Nov 5, 2007, at 1:40 PM, Ron Garret wrote:
> I know at least one thing that I'm doing Wrong, namely, making the
> text bold by setting the font to a fixed bold font instead of
> scanning the selected range, pulling out the fonts that are already
> applied, and making them bold. But this seems like a lot of
> complexity to do something that it seems to me ought to be very
> simple, so I thought I'd post this code and get a mid-course
> correction before I dove in deeper.
You can use something like:
(#/applyFontTraits:range: ts #$NSBoldFontMask range)
(see ccl:cocoa-ide;apropos-window.lisp, which uses this method)
> There's another thing that doesn't feel quite right, and that is
> having to gin up both an ns-window and an ns-view and make the ns-
> view be the ContentView of the ns-window. Back in the good old days
> of MCL, window inherited from view (so you could add subviews
> directly to a window), but ns-window doesn't inherit from ns-view so
> it seems this little jigjog is necessary. Is that right?
When an NSWindow is created, it already has an empty content view;
there's no need to make another one.
More information about the Openmcl-devel