• 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: Problem with custom control in NSToolbar
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with custom control in NSToolbar


  • Subject: Re: Problem with custom control in NSToolbar
  • From: Renaud Boisjoly <email@hidden>
  • Date: Mon, 2 Aug 2004 00:46:56 -0400

Hi Laurent!

I was having the same issue it seems, and simply adding:

[[imagePopUpButton2 cell] setUsesItemFromMenu: YES];

Fixed it. This way the menu item uses the icon from the selected menu item as its icon and it then worked... I may be totally of here of course as a lot of your message is above my head...

My issue with this subclass is that my submenu appears at the bottom of the window and not underneath the icon itself in the toolbar... any ideas?

- Renaud

On 7-Jun-04, at 5:36 PM, email@hidden wrote:

Subject: Problem with custom control in NSToolbar
From: Laurent Daudelin <email@hidden>
To: Cocoa-Dev <email@hidden>

Hi all!

I have a problem which had me pulling my hairs for the last couple of days.
I finally decided to ask here for help before I no longer have hairs to pull
out!

Basically, I took the "ImagePopUpButton" class from
<http://iratescotsman.com/products/source/> to use it in a toolbar. This is
a subclass of NSPopUpButton that reproduces the behavior of popup toolbar
items in Xcode, for example.

After making some additions to the code (NSCoding protocol since NSToolbar
seems to encode some items at some point), the popup button works fine.
However, when I choose to customize the toolbar, the icon doesn't show up in
the customization palette. Only the title. If I remove the current item from
the toolbar, then drag the one from the palette, it will appear immediately.
I've checked everything I could think of, be it the min size of the toolbar
item and its max size, the cellframe where the custom cell is displaying
those icons, I can't for the life of me finding what is missing.

Anybody has any idea or ran into a similar issue? Code is available upon
request to <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: Magnified Dock-Like View
  • Next by Date: Re: Find panel
  • Previous by thread: Re: Magnified Dock-Like View
  • Next by thread: Re: Problem with custom control in NSToolbar
  • Index(es):
    • Date
    • Thread