Dynamic Menu Bars
Dynamic Menu Bars
- Subject: Dynamic Menu Bars
- From: Andre Schnoor <email@hidden>
- Date: Fri, 10 Aug 2007 10:00:40 +0200
Hi list,
working with dynamic menu bars seems to be harder than expected for me.
Yes, I know, Mac apps should not switch the menu bar (and I fully agree
here), but the software suite I am porting consists of a host of
different tools all run within the same process, i.e. different windows
actually present distinct "applications" of their own. I'll try my best
to merging as many of their items into one menu bar, but it will still
be necessary to modify the menu bar at least in part.
Now my questions:
1) When creating a new NSMenu for the menu bar from scratch, I can't
seem to make the first "Application Name" item appear in boldface. I
tried setAttributedTitle: with NSAttributedString using a bold font - no
avail (I also wonder why the item reports its title as "Apple"). Is
there any hidden (Carbon?) magic behind this? How is this item supposed
to be created dynamically? Any undocumented tags or flags?
2) Alternatively, I started modifying menu bar items in-place,
preserving the first one (which I am unable to create from scratch).
This however causes hefty flicker and sometimes the menu bar even
doesn't show any item at all (blank!). The items however, are still
there and working. Hu? Looks like the drawing of the menu sometimes
happens while modification is still in process. Pushing the setMainMenu:
call to the main thread didn't help. Also tried itemChanged: and update
messages, but with limited success. Is there a recommended solution to
avoid this "hidden menu" artefact?
Any suggestion is appreciated. Thanks in advance.
Andre
_______________________________________________
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