gnustep-dev
[Top][All Lists]
Advanced

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

Changes for Menu and Popup


From: Fred Kiefer
Subject: Changes for Menu and Popup
Date: Mon, 25 Feb 2002 17:58:06 +0100

Hi Michael,

I had a closer look at your patches for NSMenu, and first I have to
admit that my idea to move the [_view setNeedsDisplayForItemAtIndex:
index]; call into the [NSMenuView itemChanged:] method was totally
wrong. That way we would get another call to [NSMenuView sizeToFit]
immediately. But your solution is not much better. Two consecutive
changes to the same menu item would still result in two resizes of the
view. We must come up with something better than that.

As for the changes in [NSMenu sizeToFit] I would like to see a more
general solution. We might use our knowledge, that a menu has now window
decoration and avoid the [NSWindow setContentSize:] calls here, as you
did for the popup button case. But we could as well optimize the
[NSWindow setFrame:] method. If the size and origin of the new frame is
the same as the old we don't have to do anything here. (This would
include not to draw, even if this was requested, as done by
[setContentSize:]) But I would like to here some more opinions on this
before changing it.

As for the rest of your changes I still don't understand them after
having studied them for almost two hours. This confusion is partly
caused by the way the AppKit framework does NSPopupButtons.
(NSPopupButtonCell inherits from NSMenuItemCell and owns a NSMenu as
well...) But your code looks like you are adding even more special case
handling to the already messed up code. Perhaps this is the only way to
get the optical appearance right. Still I hope that there is a cleaner
solution. We could start our search for this by defining exactly what
should happen at what stage and how the elements should look like. 

Sorry, if this is all a bit disappointing for you. If your think that
the way you changed the code is the correct way to do it I don't want to
stop you.

Fred





reply via email to

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