discuss-gnustep
[Top][All Lists]
Advanced

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

Re: NSBrowser, "allow empty selection", active delegates and wrong colum


From: Fred Kiefer
Subject: Re: NSBrowser, "allow empty selection", active delegates and wrong columns
Date: Mon, 05 Nov 2007 18:03:35 +0100
User-agent: Thunderbird 1.5.0.12 (X11/20060911)

Nikolaus Waxweiler wrote:
> I just stumbled over the following: I have a NSBrowser, an active
> delegate to fill it in and an action method when I click on some item. I
> also disabled "allow empty selection", so when I click a branch in one
> column, the first item of the next one is automatically selected. This
> has the side effect that the clicked column, as reported to the action
> method, is off by one, unless there are no items in the next column.
> This doesn't happen with a passive delegate, where the first item in the
> next column is not automatically selected. Here are 2 samples: same
> .gorm file with "allow empty selection" disabled, but different
> delegates:
> http://www.multimania.com/madleser/coding/NSBrowser-DontAllowEmptySelection-ActPsvDelegate-Bug.tar.bz2
> -- note the log output.
> 
> Is this a bug or intended?

First thank you for the excellent testing code you send along and an
apology for not looking into this problem earlier.

I did so now and I am still not sure, whether this is a bug or a
feature. What happens is that when your own code in the active delegate
calls addColumn on the NSMatrix (for Cocoa this call needs to be
addRow!) the code inside of NSMatrix sees that an empty selection is not
allowed for the matrix and selects the first cell. This leads to the
wrong column being reported as selected.
So GNUstep here sticks to the specification, still the result is
different from Cocoa and for the user surprising.
One way to work around it would be to set some of the matrix behaviour
only after the cells have been created. Or one could inspect if the
GNUstep NSMatrix behaviour is already different from what Apple does.

I am a bit clueless here. Any opinions out there?





reply via email to

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