• 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: What's wrong with ToolbarItem setLabel?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's wrong with ToolbarItem setLabel?


  • Subject: Re: What's wrong with ToolbarItem setLabel?
  • From: Ryan Bates <email@hidden>
  • Date: Wed, 11 Feb 2004 08:22:50 -0800

Is your toolbar in "Text Only" mode? If you want a menu in text mode then you will need to use NSToolbarItem's "setMenuFormRepresentation:" method. I suggest using this if you have a popup menu toolbar item.

If it is not in text only mode but the label is still disabled and the popup menu is not, try command-clicking the toolbar button (top right of window) a few times. I've had this happen in Panther before where the label was disabled; but, after cycling through the toolbar view modes, it came back. A bug in Panther perhaps?

Also, if the toolbar is customizable, you should set the palette label attribute: [toolbaritem setPaletteLabel:paletteLabel].

"Sets the receivers label that appears when it is in the customization palette to paletteLabel. An item must have a palette label if the customization palette is to be used, and for most items it is reasonable to set paletteLabel to be the same value as label. One reason for paletteLabel to be different from label would be if its more descriptive; another might be if there is no label."
<http://developer.apple.com/documentation/Cocoa/Reference/ ApplicationKit/ObjC_classic/Classes/NSToolbarItem.html>

Hope this helps.

Ryan


On Feb 11, 2004, at 5:04 AM, Manish Pattath wrote:

Hi All,
I have a problem at hand. A customView with one
NSPopUpButton is the first element in the toolbar. In
Mac OSX 10.2- the Popup button and the text[using
setlabel] appear correctly, but in panther, the label
is never enabled.

I use the following code to add this element to the
toolbar - m_MailboxView here is the outlet to the
PopUpButton

[toolbarItem setLabel:[[m_UIBundle
objectForInfoDictionaryKey:@"IDS_LOCATION"]
description]];
[toolbarItem setToolTip:[[m_UIBundle
objectForInfoDictionaryKey:@"IDS_TBAR_LOCATION_TTIP"]
description]];
[toolbarItem setTarget:self];
[toolbarItem
performSelector:@selector(setView:)
withObject:m_MailboxView];
if ([toolbarItem view]!=NULL)
{
[toolbarItem setMinSize:[[toolbarItem
view] bounds].size];
[toolbarItem setMaxSize:[[toolbarItem
view] bounds].size];
}
[toolbarItem
setAction:@selector(onToolbarSelectMailbox:)];

All other toolbar items appear correctly,even in
Panther.I have problem only with the label under the
PopupButton which is always disabled.
can anyone tell me what is wrong?

_______________________________________________________________________ _
Yahoo! India Education Special: Study in the UK now.
Go to http://in.specials.yahoo.com/index1.html
_______________________________________________
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.
_______________________________________________
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.

  • Follow-Ups:
    • Re: What's wrong with ToolbarItem setLabel?
      • From: Manish Pattath <email@hidden>
References: 
 >What's wrong with ToolbarItem setLabel? (From: Manish Pattath <email@hidden>)

  • Prev by Date: NSTableView and confused Drag&Drop
  • Next by Date: Re-enabling Expose for certain windows
  • Previous by thread: What's wrong with ToolbarItem setLabel?
  • Next by thread: Re: What's wrong with ToolbarItem setLabel?
  • Index(es):
    • Date
    • Thread