• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Add nscontrol to the Main Window using code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Add nscontrol to the Main Window using code? (From: Silicon <email@hidden>)
 >Re: Add nscontrol to the Main Window using code? (From: Georg Tuparev <email@hidden>)

  • Prev by Date: NIB file compatibilty
  • Next by Date: Re: NIB file compatibilty
  • Previous by thread: Re: Add nscontrol to the Main Window using code?
  • Next by thread: Re: Add nscontrol to the Main Window using code?
  • Index(es):
    • Date
    • Thread