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: Michael Watson <email@hidden>
- Date: Tue, 13 Feb 2007 11:55:25 -0500
No offense at all, but you've been asking a lot of basic questions
lately. Might I suggest, and again I mean this not as an insult,
picking up a good book on Cocoa?
The Hillegaas book is pretty well-liked.
--
m-s
On 13 Feb, 2007, at 11:45, Silicon wrote:
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:
40bungie.org
This email sent to email@hidden
_______________________________________________
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