Re: a simple task for Simula based languages
Re: a simple task for Simula based languages
- Subject: Re: a simple task for Simula based languages
- From: Vlad Alexa <email@hidden>
- Date: Sat, 17 Nov 2007 18:29:47 +0200
Trying to be as explicit as i can here is the actual code :
items=[[NSMutableDictionary alloc] init];
NSToolbarItem *item=[[NSToolbarItem alloc]
initWithItemIdentifier:@"Name"];
[item setPaletteLabel:@"Name"];
[item setLabel:@"Name"];
[item setToolTip:@"Tip"];
[item setImage: [NSImage imageNamed:@"icon"]];
[item setTarget:self];
[item setAction:@selector(toolbaritemclick:)];
[items setObject:item forKey:@"Name"];
NSToolbarItem *item=[[NSToolbarItem alloc]
initWithItemIdentifier:@"Name1"];
[item setPaletteLabel:@"Name1"];
[item setLabel:@"Name1"];
[item setToolTip:@"Tip1"];
[item setImage: [NSImage imageNamed:@"icon1"]];
[item setTarget:self];
[item setAction:@selector(toolbaritemclick1:)];
[items setObject:item forKey:@"Name1"];
the obvious scope is to be able to call this code only once for each
button and besides it have only one line of code for each button
that supplies the parameters name,tip,icon and action.
On Nov 17, 2007, at 6:05 PM, Raffael Cavallaro wrote:
On Nov 17, 2007, at 10:50 AM, Vlad Alexa wrote:
Sorry for not having the most correct code for illustration purposes.
When requesting help (in any language) it's usually best to post
what you've already written so far. This makes your intention
clearer. If you need to keep details hidden for whatever reason you
can change variable, class and method names in the snippet you post.
regards,
Ralph
Raffael Cavallaro, Ph.D.
email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden