Re: Quartz call to generate shadows?
Re: Quartz call to generate shadows?
- Subject: Re: Quartz call to generate shadows?
- From: email@hidden
- Date: Thu, 21 Feb 2002 18:35:21 -0800
Now that I think about it... Shouldn't the system draw a shadow behind
my NSControl subclass by default? It can't be the case that NSButton
and every other control draws its own shadow. I just noticed that the
shadows are drawn on the parent view, outside the frame of the
controls... So, should I expect a shadow to be drawn behind a custom
control? or not?
On Thursday, February 21, 2002, at 01:19 PM, email@hidden wrote:
I found this thread in the archives from October of last year... Scott
implied that John Geleynse from Apple would have some input on how to
draw shadows properly in the future... Has anything constructive
happened on this front in the last four months?
I have written a clone of NSProgressIndicator that is a subclass of
NSControl and uses an NSCell subclass for drawing, so it is easier to
integrate into NSTableView... it is identical, except for the shadow...
so I'd love it if there was a blessed way to draw these...
On Monday, October 8, 2001, at 11:02 PM, Scott Herz wrote:
I'm not on the CG team, but be prepared for this not to work in an
upcoming version of 10.
Scott.
On Sunday, October 7, 2001, at 03:39 AM, Finlay Dobbie wrote:
On Sunday, October 7, 2001, at 06:12 am, John C. Randolph wrote:
Does anyone know how to get hold of Quartz's code for generating
shadows around windows? I'd like to create shadows from bitmaps
using
the same algorithm.
There is a way of setting shadowing on the current graphics context,
but
for some reason it's private. This is how ASM does it:
// private SPI function definitions into the CoreGraphics framework
extern void *CGSReadObjectFromCString(char*);
extern char *CGSUniqueCString(char*);
extern void *CGSSetGStateAttribute(void*,char*,void*);
extern void *CGSReleaseGenericObj(void*);
void *r27, *r29;
[NSGraphicsContext saveGraphicsState];
r27 = CGSReadObjectFromCString("{ Style = Shadow; Height = 2;
Radius = 2; Azimuth = 90; Ka = 0.6; }");
r29 = [[NSGraphicsContext currentContext] graphicsPort];
CGSSetGStateAttribute(r29, CGSUniqueCString("Style"), r27);
; << do drawing >>
[NSGraphicsContext restoreGraphicsState];
CGSReleaseGenericObj(r27);
-- Finlay
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.