🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: comp.sys.next.programmer
1 messages
1 total messages Started by Lyle Parkyn Sat, 15 Aug 1992 20:56
TextField: can't change textGray and seemingly weird side effects
#1170
Author: Lyle Parkyn
Date: Sat, 15 Aug 1992 20:56
37 lines
2150 bytes
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.

	[[[nameText  setEditable:NO] setEnabled:NO]  setSelectable:NO];
	[[nameText setBordered:NO] setBezeled:NO];	
	[[nameText setBackgroundTransparent:YES] setBackgroundGray:NX_WHITE];
	[nameText setTextGray:NX_BLACK];	
	[nameText setAlignment:NX_CENTERED];
	(where nameText is a alloc'd and initFrame'd TextField)
 
The offending line was
	[[[nameText  setEditable:NO] setEnabled:NO] setSelectable:NO];
if I just did
	[nameText  setSelectable:NO];
then the textGray could be changed.

Further reading showed that setSelectable:NO makes the text static and  
noneditable (not unexpected). Doing a setEditable:NO and setEnabled:NO before  
the setSelectable:NO, however, seems to have the side effect of permanently  
setting the textGray.  I even tried the setTextGray method of TextFieldCell  
(after getting the textfields cell) without success.

In the strictest sense of the word I could see that setEditable:NO might mean  
nothing about the textfield is changable, however, the text is changable which  
kind of violates that idea.

I am left with the conclusion that TextField has some methods with undocumented  
and undesirable side effects. Did anyone else have similar experiences? 

Makes me wonder what other land mines are scattered in the Appkit.:-) I don't  
have the FAQ which possibly covers all this, in which case "Never Mind".

-- 
=====
ldp@pkyn.questor.wimsey.bc.ca (Mail and/or NeXTMail )
Lyle Parkyn - Reveal Development Service
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