discuss-gnustep
[Top][All Lists]
Advanced

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

Re: List of GNUstep fixes


From: Andreas Höschler
Subject: Re: List of GNUstep fixes
Date: Thu, 19 Jan 2006 22:21:53 +0100

Hi Fred,

*NSPopUpButtonCell*

- (void)synchronizeTitleAndSelectedItem
{
int index;

if (!_pbcFlags.usesItemFromMenu) return;

if ([_menu numberOfItems] == 0)
{
index = -1;
}
else if (_pbcFlags.pullsDown)
{
index = 0;
}
else
{
index = [[_menu menuRepresentation] highlightedItemIndex];
if (index < 0) index = [self indexOfSelectedItem];
// if (index < 0) index = 0; // <--------------- this is bad
}

if ((index >= 0) && ([_menu numberOfItems] > index))
{
NSMenuItem *anItem;


// This conversion is needed as [setMenuItem:] expects an NSMenuItem
anItem = (NSMenuItem *)[_menu itemAtIndex: index];
[self setMenuItem: anItem];
}
else
{
[self setMenuItem: nil];
}
}

Here our implementations matches the specification, why should we
deviate from that?

Because the behaviour is simply wrong.

selectItem:
- (void)selectItem(id <NSMenuItem>)anObject

Selects the menu item
anObject in the pop-up menu. If anObject is nil, all items in the menu are deselected (this is a technique for obtaining a pop-up menu with no items selected).


When I send selectItem:nil to a NSPopUp I want the selection to vanish. This works on MacOSX as it should. On GNUstep the above mentioned line prevents the correct behaviour.

Regards,

Andreas






reply via email to

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