bug-gnustep
[Top][All Lists]
Advanced

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

Re: NSPopUpButton*, NSMenu* patch.


From: Fred Kiefer
Subject: Re: NSPopUpButton*, NSMenu* patch.
Date: Wed, 20 Feb 2002 23:58:59 +0100
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-DE; rv:0.9.4) Gecko/20011019 Netscape6/6.2

Hi Michael,

I just had a look at your patch and failed to understand how with the new code you suggest for NSApplication the name of a window could be changed and correctly displayed in the windows menu. Perhaps you just wanted to optimize the case away, when the name didn't actually change?

As for the rest of your patch I would like to analyse it a bit more before committing it. It is a rather huge patch and there is some code that looks strange. (E.g. why is the setNeedsDisplayForItemAtIndex method called in the NSMenu implementation of itemChanged and not in that of NSMenuView?) Sorry, but the menus are a very complicated and important aspect of GNUstep and I did spend quite some time last year to sort them out at least half (I gave up on the popup buttons and on moving more code from the menu to the menu view).

Cheers
Fred

Michael Hanni wrote:

Hi,

Here is a rather large patch that makes some changes to NSMenu* and
NSPopUpButton*. Basically it allows one to use images in popupbuttons once
again and it removes many redisplays which were causing the menus and popups to
be quite painful on slow machines (bonus: the windows menu should display a
little better both as a tornoff and as a regular menu.) Finally, it also
includes a change to NSTabView which addresses a bug noted on discuss-gnustep.

There are still issues, but I believe this patch is some improvement (it makes
things nicer on my slow machine. :))

ChangeLog:

        * Source/NSApplication.m: (-changeWindowsItem:) If the item in
        question already exists we abort further processing.
        * Source/NSMenu.m: (-itemChanged:) Mark the menuitemcell that has
        changed for redisplay (thus allowing us to only redisplay the
        item changed as opposed to the entire view.)
        (-sizeToFit) Alot of reformulation to suppress multiple
        redisplays.
        (-_popUpButtonCell) Allow access to the popupbuttoncell privately.
        * Source/NSMenuItemCell.m: Moved drawing of popupbutton icon here.
        Also, reallow use of NSImages in an NSPopUpButton.
        (-imageRectForBounds:) Remove popupbutton code.
        (-drawImageWithFrame:) Dim image if item is not enabled.
        (-_drawPopUpIconWithFrame:) New method to draw popupbutton icons.
        (-drawInteriorWithFrame:) Draw popupbutton icon if needed.
        * Source/NSMenuView.m: (-sizeToFit) Check for popupbutton to
        remove additional 1 pixel.
        * Source/NSPopUpButtonCell.m: reformulate drawing.
        (-drawWithFrame:) Have the menuRepresentation fetch us the
        NSMenuItemCell for the selectedItem and draw it.
        (-drawInteriorWithFrame:) Remove all code save for NSDottedRect
        drawing.
        * Source/NSTabView.m: (-mouseDown:) new method to fix problems
        with NSSplitView interaction.
        (-hitTest:) removed.

Cheers!

Michael

__________________________________________________
Do You Yahoo!?
Yahoo! Sports - Coverage of the 2002 Olympic Games
http://sports.yahoo.com






reply via email to

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