• 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
Add nscontrol to the Main Window using code?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Add nscontrol to the Main Window using code?


  • Subject: Add nscontrol to the Main Window using code?
  • From: Silicon <email@hidden>
  • Date: Tue, 13 Feb 2007 16:45:37 +0000

Hi all
I want to implement a function which can add nscontrol to main window using code, for example, I can customize the GUI by adding anything as I want, like NSSlider, NSTextField, NSImage.
But I come across a problem , when I add a nsslider to the main window using the following code:
NSView * contentView = [myWindow contentView];
NSControl * userControl;

userControl = [[NSSlider alloc] initWithFrame:NSMakeRect(20,20,18,20)];
[[userControl cell] setSliderType:NSCircularSlider];
[(NSSlider *) userControl setMaxValue: 10.0];
[(NSSlider *) userControl setMinValue: 0.0];
[contentView addSubview:userControl];


And then add a NSSlider to the main window using the interface builder, You can run the code and find that the appearance of the sliders are very different between the two methods.

Can someone tell me how should I do to implement the IB-style appearance? You should find my code-generated slider is very ugly.

Thanks for any help!
_______________________________________________

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


  • Follow-Ups:
    • Re: Add nscontrol to the Main Window using code?
      • From: Michael Watson <email@hidden>
    • Re: Add nscontrol to the Main Window using code?
      • From: Georg Tuparev <email@hidden>
  • Prev by Date: Re: Printing crash
  • Next by Date: Re: Add nscontrol to the Main Window using code?
  • Previous by thread: Re: NSTableView and Releasing window controllers
  • Next by thread: Re: Add nscontrol to the Main Window using code?
  • Index(es):
    • Date
    • Thread