• 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
Re: a simple task for Simula based languages
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: a simple task for Simula based languages
      • From: Bill Bumgarner <email@hidden>
References: 
 >a simple task for Simula based languages (From: Vlad Alexa <email@hidden>)
 >Re: a simple task for Simula based languages (From: John Stiles <email@hidden>)
 >Re: a simple task for Simula based languages (From: Vlad Alexa <email@hidden>)
 >Re: a simple task for Simula based languages (From: Raffael Cavallaro <email@hidden>)

  • Prev by Date: Re: a simple task for Simula based languages
  • Next by Date: Re: Cocoa-dev Digest, Vol 4, Issue 1182
  • Previous by thread: Re: a simple task for Simula based languages
  • Next by thread: Re: a simple task for Simula based languages
  • Index(es):
    • Date
    • Thread