Add nscontrol to the Main Window using code?
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