Re: NSApplicationMain question
Re: NSApplicationMain question
- Subject: Re: NSApplicationMain question
- From: "Paul Sanders" <email@hidden>
- Date: Mon, 26 Apr 2010 15:06:25 +0100
> did anyone have some more color on question (2) the need to create a raw
> NSScroller and control it like a NSSlider (min, max, value, proportion) is
> that possible?
Yes, just instantiate it and call initWithFrame. Then add it to your window's content view, which will retain it so you can release it. Other than that, consult the NSScroller docs (and read up on the target/action mechanism for NSControls so that you can catch events generated by the scroller).
Addendum to my earlier post: requests to draw come though your content view's drawRect: method (or said method of any subviews thereof), so yu can use that to trigger the drawing of any 'bare metal' widgets. To force a redraw, call setNeedsDisplay or setNeedsDisplayInRect: on your content view.
I learnt all this stuff by reading about it and by experimenting with my toy Cocoa app... It's a method that works. Apple's Cocoa framework docs are actually very good. They should all have been installed with Xcode.
Paul Sanders.
_______________________________________________
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