Thread View: comp.sys.next.programmer
2 messages
2 total messages
Started by Dave Hess
Mon, 13 Apr 1992 16:06
Problem ending a cell edit in a Matrix
Author: Dave Hess
Date: Mon, 13 Apr 1992 16:06
Date: Mon, 13 Apr 1992 16:06
25 lines
1378 bytes
1378 bytes
I've got a matrix full of TextFieldCells with some of them editable/selectable and some of them not. When I go to reload the Matrix with new values I get a redraw problem in the cell that is currently being edited. All the other cells get redrawn fine, just the one being edited is munged. I finally realized that I probably need to end the editing before I update. I've tried selecting the cell at (-1,-1) as suggested in the documentation but it produces no change. The same cell is still being edited. The Matrix is in track mode and I do have the cell background gray set. I've also tried setting the Matrix to allow an empty selection which is only supposed to apply for radio mode with no luck. I've pored over the class references for quite a while and come up clueless. Anybody got suggestions or know what I'm missing? Dave ---- David K. Hess Graduate Student Texas A&M University dhess@cs.tamu.edu
Re: Problem ending a cell edit in a Matrix
Author: Charles Herrick
Date: Tue, 14 Apr 1992 16:21
Date: Tue, 14 Apr 1992 16:21
53 lines
2427 bytes
2427 bytes
In article <12304@tamsun.tamu.edu> d1h1883@himalia.tamu.edu.tamu.edu
(Dave Hess) writes:
$ I've got a matrix full of TextFieldCells with some of them
$ editable/selectable and some of them not. When I go to reload the
$ Matrix with new values I get a redraw problem in the cell that is
$ currently being edited. All the other cells get redrawn fine, just
the
$ one being edited is munged. I finally realized that I probably need
to
$ end the editing before I update. I've tried selecting the cell at
$ (-1,-1) as suggested in the documentation but it produces no
change.
$ The same cell is still being edited.
$
$ The Matrix is in track mode and I do have the cell background gray
$ set. I've also tried setting the Matrix to allow an empty
selection
$ which is only supposed to apply for radio mode with no luck.
don't know if this helps or not, but regarding an end of edit, I
found this in Window.rtf:
BEGIN--CUT HERE--
endEditingFor:
- endEditingFor:anObject
Makes the Window's field editor (a Text object) available for a new
editing assignment by detaching it from the object it's currently
serving (normally its superview and delegate). If the field editor
is the first responder, the Window is made the new first responder.
This forces a textDidEnd:endChar: message to be sent to the field
editor's delegate. The field editor then is assigned a nil delegate
and is removed from the view hierarchy (its superview is made nil).
This forces an end to editing even if the field editor had refused to
resign its status as the first responder.
To conditionally end editing, first try to make the Window the first
responder:
if ( [myWindow makeFirstResponder:myWindow ] ) {
[myWindow endEditingFor:nil];
. . .
}
makeFirstResponder: returns nil if the current first responder won't
resign. This is the preferred way to verify all fields when an OK
button is pressed in a panel, for example.
Returns self.
See also: - getFieldEditor:for:
END--CUT HERE--
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads