gnustep-dev
[Top][All Lists]
Advanced

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

Re: Strange behaviour on cells


From: Benhur Stein
Subject: Re: Strange behaviour on cells
Date: Fri, 21 Feb 2003 13:52:15 -0300
User-agent: Internet Messaging Program (IMP) 3.0

Citando Adam Fedor <address@hidden>:

> Benhur Stein wrote:
> > 
> > Hi!
> > 
> > While trying to understand the implementation of NSMatrix, I came to
> > some behaviour of NSCell and NSButtonCell that seems to be wrong.
> > Can anybody with more knowledge (or access to OS or OSX) verify this?
> > 
> > - A radio button shows its state by using an alternate image (the one
> >   where it is selected) when it is in the ON state. It uses the same
> >   image to show when it is highlighted, even if it's state is OFF.
> >   The problem is, when it is both highlighted and ON, it shown it's
> >   normal image (the one where it is not selected), and that seems
> >   plain wrong to me.
> 
> Isn't highlighting used to show what will happen if you let up on the 
> mouse? In that case it seems like that is the correct behavior to me. 
> Perhaps I'm missing something, though.

Probably it is me who is missing something...
I was trying to do some clean up in NSMatrix code, and the code in 
_mouseDownNonListMode seemed overly complicated to me, but after some
thought, it seems like that is the way to make it work if cells display
and change state the way they do during tracking. But it seemed wrong
to me because during tracking a matrix of radio buttons is put in
an inconsistent state, where one cell is marked in the matrix as selected 
but the corresponding cell is in an OFF state (because if the
mouse goes up in the cell, that cell will have its state changed before 
the action is sent, and the target should receive the action with one
cell selected and in its ON state). Some problems I've seen while looking 
at the code:

- tri-state cells do not work, because cells are put in OFF state before
  tracking.
- another problem with tri-state cells is highlighting: if highlighting is
  used to show what will happen when button is released, it should show the
  next of the three states.
- matrixes that allow empty selection: clicking on the selected button should 
  deselect it
- what happens if the cell is configured to send its action on mousedown or
  continuously? Should it change its state before sending the action too?

I can implement this on NSMatrix (I have some other patches on NSMatrix 
to send), if anybody can confirm if the current behaviour of 
NS(Button)Cell is correct wrt highlighting and changing state during 
tracking (or what the correct behaviour should be). I can make a small 
program to test this, if someone can run it on OS or OSX, but I won't 
have time before monday.

Benhur




reply via email to

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