Re: Dynamic Menu Bars
Re: Dynamic Menu Bars
- Subject: Re: Dynamic Menu Bars
- From: Andre Schnoor <email@hidden>
- Date: Fri, 10 Aug 2007 14:00:11 +0200
Uli Kusterer wrote:
On 10.08.2007, at 10:00, Andre wrote:
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?
This should work, but not from a non-main thread. The kind of
artefacts you mention are exactly the glitches one gets when doing GUI
stuff from a secondary thread. Are you sure you've moved all of your
menu code into the main thread? What about other GUI code?
Ah, thanks Uli.
Hm, I only pushed the #setMainMenu: message to the main thread. The
modification of the menu "in-place" however happens on another thread. I
see that this may disrupt a redisplay issued by Aqua.
Anyway, the problem seems so be somewhere else: I just checked an
alternative solution that assembles a new menu from scratch ("offline")
and issues a #setMainMenu: only once. Still the same artefact every now
and then. Although less frequently.
I'd rather prefer the "offline" construction, because it doesn't cause
any flicker, but still have no clue how to make the first item *bold*
... argh. BTW making a copy of the original menu item loaded from the
NIB also removes the bold item plus its name (replaced by "Apple"). This
is really weird ...
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