Re: +poseAsClass and instance variables
Re: +poseAsClass and instance variables
- Subject: Re: +poseAsClass and instance variables
- From: email@hidden
- Date: Fri, 22 Feb 2002 23:29:05 -0800
I'm actually having a class pose as NSThemeFrame. Subclassing an
NSWindow isn't terribly effective. NSBorderlessWindows don't have have
hardware accelerated window dragging. Nor have I found a way to access
HW accelerated dragging from anywhere but the title bar. Thus, I had to
dip into the private APIs (with significant assistance from a helpful
Swede.)
Is there an easier way to draw into a window's title bar? While I'm at
it, I draw quite a bit of stuff so its necessary to access a static
dictionary quite frequently. The other option is to load the values at
the start of each instance method.
Well, you could probably draw into the window's frame by just
expanding your clipping area inside some view's drawRect: method; I
don't think there's anything besides the clipping of the current gState
keeping you from drawing outside your bounds. I'm not sure that you
could change the window's shape with such drawing, though; I think
CoreGraphics might calculate and cache the window's region after the
window draws. Nothing like trying it to find out. :->
As for the dictionary accesses; it depend on how many accesses "quite
frequently" really is. I would guess that as many as 100 accesses would
be entirely invisible; 1000 might start to show up. That's *very*
seat-of-the-pants, though. I would write the code to just access the
dictionary as needed, and then run Sampler on it and see whether
-objectForKey: shows up at more than 1% or 2%.
Ben Haller
Stick Software
_______________________________________________
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.