Re: Configure a button added in IB
Thanks! Works like a charm. Didn't work at first because I put theButton = [[NSButton alloc] init]; before the [theButton setTitle:@send steve money]; When that was removed, it worked ok (and you will probably get your money). wamund 16 nov 2008 kl. 02.48 skrev Steven Riggs: To do it from code, add something like.. IBOutlet NSButton *theButton; ...to your .h Instanitate your class in interface builder and then connect theButton to your button my control dragging from your class to the button. and then use the documentation here: http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSButton_Class/Reference/Reference.html ...to learn what kind of messages you can send to it. ex. [theButton setTitle:@send steve money]; :-) Good luck, Steven Riggs On Nov 15, 2008, at 7:04 PM, Mikael Wämundson wrote: Am a quite a newbie to Cocoa programming. Adding and configuring a button in IB is straightforward. I understand the process of setting action and target in IB and the connection to Xcode (IBOutlet and IBAction). But what is the approach when creating a button in IB that I then want to configure (set title, image, enabled, etc.) in Xcode? How do I reach the button from Xcode? wamund ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/steven.riggs %40me.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Configure a button added in IB
Am a quite a newbie to Cocoa programming. Adding and configuring a button in IB is straightforward. I understand the process of setting action and target in IB and the connection to Xcode (IBOutlet and IBAction). But what is the approach when creating a button in IB that I then want to configure (set title, image, enabled, etc.) in Xcode? How do I reach the button from Xcode? wamund ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]
Re: Configure a button added in IB
To do it from code, add something like.. IBOutlet NSButton *theButton; ...to your .h Instanitate your class in interface builder and then connect theButton to your button my control dragging from your class to the button. and then use the documentation here: http://developer.apple.com/documentation/Cocoa/Reference/ApplicationKit/Classes/NSButton_Class/Reference/Reference.html ...to learn what kind of messages you can send to it. ex. [theButton setTitle:@send steve money]; :-) Good luck, Steven Riggs On Nov 15, 2008, at 7:04 PM, Mikael Wämundson wrote: Am a quite a newbie to Cocoa programming. Adding and configuring a button in IB is straightforward. I understand the process of setting action and target in IB and the connection to Xcode (IBOutlet and IBAction). But what is the approach when creating a button in IB that I then want to configure (set title, image, enabled, etc.) in Xcode? How do I reach the button from Xcode? wamund ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/steven.riggs%40me.com This email sent to [EMAIL PROTECTED] ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please 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: http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to [EMAIL PROTECTED]