discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSPopUpButton - results on MacOSX


From: Fred Kiefer
Subject: Re: NSPopUpButton - results on MacOSX
Date: Sat, 13 Oct 2001 16:21:21 +0200

As Pascal and Georg showed the only two things still wrong with our
implementation of popup buttons are the autoenabling and the selected
index while processing a mouse down.

Georg Fleischmann wrote:
> I realized that on OpenStep for PopUpButtons autoenablesItems is NO, on  
> GNUstep it is YES.
> The OpenStep documentation says that autoenablesItems is YES by default, but  
> could the documentation be wrong here?

Pascal Bourguignon wrote:
> If only the GNUstep implementation would enable the pop-up menu items,
> when setting the action to the NSPopUpButton, it would be perfect...

Somehow even now the popup menu gets updated when you move the base
window around a bit.

For this to work we could either call the [NSMenu update] method when
setting the target or action of a popup button. Or we could generalize
the code that calls this update method every time a user event is
processed. Currently we only update the main menu in the [NSApplication
run] method, but could send a notification to all menus that they should
update themselves. The Mac OSX specification states that all menus with
auto enabling switched on, will update themselves, so the second
solution would be correct.

So for now I will implement the simple change in NSPopUpButtonCell to
update the menu when target or action are set. And for the second change
we should have a bit of a discussion on it.

As for the selected item, it would be fairly easy to set that in the
menu before sending the action, but even than the selected item of the
popup would be different from that of the menu view most of the time. So
I would like a better solution. One way could be to get the selected
item and its index directly from the menu view, while this is displayed.
This would require some changes in NSPopUpButtonCell, but nothing more.

Fred





reply via email to

[Prev in Thread] Current Thread [Next in Thread]