Re: NSScrollView: Scrollers invisible under Mac OS X 10.6
Re: NSScrollView: Scrollers invisible under Mac OS X 10.6
- Subject: Re: NSScrollView: Scrollers invisible under Mac OS X 10.6
- From: Graham Cox <email@hidden>
- Date: Wed, 2 Sep 2009 15:07:12 +1000
On 02/09/2009, at 2:30 PM, Matthias Arndt wrote:
It was my understanding that a custom view could be zoomed in (at
least) two ways:
(1.) using "scaleUnitSquareToSize" of the clip view (leaving the
coordination system of the custom view untouched) or
(2.) changing the bounds / frame of the custom view and handling the
scaling in the custom view's drawRect:
As the first one worked (under Mac OS 10.5) and was less intrusive
to my code, I never tried the second one. To be honest I can't
remember why I used "scaleUnitSquareToSize" of the clip and not the
custom view. I'll definitely give it a try the next days ...
Hi Matthias,
If it's any help, I have a free general purpose view class that
handles zooming. It uses -scaleUnitSquareToSize internally, and
provides some high level action methods for adding zoom commands to
your app. The main thing to note is that -drawRect "just works" - you
do not have to know the current scale factor to draw things (unless
you need to explicitly compensate for the zoom, for example when
drawing selection handles, etc), which is as it should be. It has
worked fine from 10.2 to 10.6 with no changes.
Another thing to be aware of is that if you do it right, the ruler
views managed by the scrollview also "just work" and allow for the
view's zoom. I don't think you should be doing what you're doing to
the NSClipView.
http://apptree.net/gczoomview.htm
--Graham
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden