• 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: Change a NSToolbarItem appearence
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Change a NSToolbarItem appearence


  • Subject: Re: Change a NSToolbarItem appearence
  • From: Lorenzo Puleo <email@hidden>
  • Date: Mon, 24 Feb 2003 18:50:53 +0100

Ciao,
se hai creato i pulsanti della toolBar cosl:

myToolbar = [[NSMutableDictionary alloc] init];
name = @"myButton";
item = [[NSToolbarItem alloc] initWithItemIdentifier:name];
[item setPaletteLabel:name]; //



name for the "Customize Toolbar" sheet
[item setLabel:name]; //










name for the item in the toolbar
[item setView:myOutletButton]; //

Add Button
[item setMinSize:NSMakeSize(30, 30)];
[item setMaxSize:NSMakeSize(30, 30)];
[myToolbar setObject:item forKey:name]; //


add to toolbar list
[item release];

E' poi sufficiente un puntatore all'item per cambiare il nome e l'icona:
Qui la Key dell'object, la Label e la PaletteLabel hanno lo stesso nome, ma
sono tre parametri distinti.

NSToolbarItem *tempItem = [myToolbar objectForKey:@"myButton"];
if(tempItem){
[tempItem setLabel:@"New Name"];// per cambiare nome
[tempItem setPaletteLabel:@"New Name"];// per cambiare nome
[tempItem setView:otherOutletButton]; // per cambiare pulsante (e icona)
}


--
Lorenzo Puleo
mailto:email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: Adding text attributes to current cursor position
  • Next by Date: Re: Subclassing NSLayoutManager
  • Previous by thread: Re: Change a NSToolbarItem appearence
  • Next by thread: Current Working Directory Changes
  • Index(es):
    • Date
    • Thread