Thread View: comp.sys.next.programmer
1 messages
1 total messages
Started by Gregory H. Anderson
Wed, 19 Aug 1992 01:00
Re: TextField: can't change textGray and seemingly weird side effects
Author: Gregory H. Anderson
Date: Wed, 19 Aug 1992 01:00
Date: Wed, 19 Aug 1992 01:00
39 lines
2059 bytes
2059 bytes
Reply-To: greg@afs.com In article <1992Aug15.205626.2573@pkyn.questor.wimsey.bc.ca> ldp@pkyn.questor.wimsey.bc.ca (Lyle Parkyn) writes: > I found I couldn't change the textGray of a Textfield programmatically. > I eventually discovered that the following code seemed to prevent > changes to textGray. > > [stuff deleted] > > I am left with the conclusion that TextField has some methods with > undocumented and undesirable side effects. Did anyone else have similar > experiences? > The only thing that tripped you up was the setEnabled: messge. All NeXT controls respond to this method by graying themselves down in some way, to indicate their disabled state. This is a desirable user interface clue which would be defeated if you could subsequently change the color back under program control. For the record, here is the hierarchy: setEditable: - can the text be changed? setSelectable: - regardless of editable state, can the text be selected and copied with the selectText: and copy: methods? setEnabled: - will the control react to or send any actions? (NO always implies setEditable:NO and setSelectable:NO) There is a "gotcha" in the interactions of the first two methods. Sending setEditable:NO automatically performs setSelectable:NO, which I consider a mistake. So if you want the text to stay selectable, you must follow any setEditable:NO with a setSelectable:YES. -- Gregory H. Anderson | "We're very tolerant around here, Benevolent Dictator-for-Life | being only amateurs ourselves." Anderson Financial Systems | - Tortoise (Godel, Escher, Bach) greg@afs.com (Nextmail OK) |
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