bugGNUstep - Bugs: bug #42230, Calling setState: on a button from...

Group
 
 

bug #42230: Calling setState: on a button from the action method of another button doesn't work...

Submitter:  Gregory John Casamento <gcasa>
Submitted:  Mon 28 Apr 2014 11:19:54 PM UTC
   
 
Category:  Gui/AppKit Severity:  3 - Normal
Item Group:  Bug Status:  Wont Fix
Privacy:  Public Assigned to:  FredKiefer
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 27 Oct 2020 12:31:57 PM UTC, comment #3: 

Closing this since it hasn't been an issue since.  Please reopen on github if this is still of concern.

Gregory John Casamento <gcasa>
Group administrator
Fri 02 May 2014 01:36:54 PM UTC, comment #2: 

German is correct, the best way here is to use this NSMatrix method. Only then will you get the correct behaviour when you switch your matrix to radio mode.

For your specific problem it would be sufficient if either NSActionCell or NSButtonCell would override the method setState: with the usual block of code added:

  if (_control_view)
    {
      if ([_control_view isKindOfClass: [NSControl class]])
        {
          [(NSControl*)_control_view updateCell: self];
        }
    }

That way the control, in this case the matrix, would redisplay the changed button. But this hasn't been documented by Apple and would not help with the radio behaviour. I am almost sure that the old Next code could achieve this behaviour without this special method, but I haven't any clue on how to do this.

Fred Kiefer <FredKiefer>
Group Member
Thu 01 May 2014 05:58:44 AM UTC, comment #1: 

Could be this a problem with the matrix? The matrix can attempt to handle the state of their buttons. If I add an outlet to the matrix and then use:

[matrix setState: NSOnState atRow: 1 column: 0];

Instead a call to the button, it works.

Germán Arias <espectador>
Mon 28 Apr 2014 11:19:54 PM UTC, original submission:  

Use case: A gui with two buttons.   One button has an action method which calls setState: on the other button with the value NSOnState.

Procedure:
1) Run the application attached.
2) click the button

RESULT: None of the radio buttons in the matrix are highlighted.
EXPECTED: The second button from the top should be highlighted.

Procedure 2:
1) Load in the debugger
2) set a break point in buttonhit: method.
3) run the application attached in the debugger
4) hit the button, it should stop at the breakpoint
5) continue in the debugger console.

RESULT: The radio button which should have been highlighted in the previous case is now highlighted.
EXPECTED: This is what was expected, except it should have happened in the first case without the debugger breakpoint.

Does this issue indicate a race condition of some sort?  Given that GUI is single threaded I'm not sure what's going on here.

Gregory John Casamento <gcasa>
Group administrator

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #31269:  ButtonTest.tgz added by gcasa (6KiB - application/x-compressed-tar)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by FredKiefer (Posted a comment)
  • -email is unavailable- added by espectador (Posted a comment)
  • -email is unavailable- added by gcasa (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 5 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-10-27 gcasa StatusConfirmed Wont Fix
        Open/ClosedOpen Closed
    2014-05-02 FredKiefer StatusNone Confirmed
        Assigned toNone FredKiefer
    2014-04-28 gcasa Attached File- Added ButtonTest.tgz, #31269

    Back to the top

    Powered by Savane 3.13-cf05.
    Corresponding source code