Re: Add nscontrol to the Main Window using code?
Re: Add nscontrol to the Main Window using code?
- Subject: Re: Add nscontrol to the Main Window using code?
- From: Uli Kusterer <email@hidden>
- Date: Tue, 13 Feb 2007 21:23:57 +0100
Am 13.02.2007 um 12:52 schrieb Georg Tuparev:
You will save you a lot of headache if you create an offscreen
window, and set there all kinds of controls you wold like to show
dynamically. During the app execution you could copy whatever
control you want and just size it appropriately!
You only need a NIB with a view in it (just drag the "Custom View"
into the NIB's main window), there's no need to create a window
around it anymore, unless you need to be backwards compatible with
old system versions (IIRC anything before 10.2).
You can also just create a little app that loads a NIB and then
uses NSKeyedArchiver to archive your slider into an NSData object,
save that to a file and then use that file and NSKeyedUnarchiver to
create however many copies of that slider you want. Essentially
that's the same as what happens inside a NIB, the exception being
that it doesn't save any connections or bindings, only the properties.
Once I managed to do what you are trying, but it took me a day and
many gray hairs!
In general, one has to set up the correct properties, like bezel
styles and such. There's a lot of old NeXT code still in there, and
by default a button for example still draws with the NeXT look
instead of as a Mac button. While the circular slider is pretty new,
I guess you're getting something similar there.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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