Make TextEditor Widget Read-Only Programmatically

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Make TextEditor Widget Read-Only Programmatically

grovesr
This post was updated on .
I am having trouble determining how to programmatically set a TextEditor widget to be Read-Only.  I want to do something like:
(self wrapperAt: #textEditor) makeReadOnly
I don't see a method that allows me to do that, but I see that I can create the widget in the GUI Painter Read-Only, so I suspect that it can be done later during program execution also.

Upon further search, I see that I can apply #isReadOnly: to the wrapper spec:
(self wrapperAt: #textEditor) spec isReadOnly: true
But I'm not sure what I have to do to cause the #textEditor to pick up that spec.
Any help would be greatly appreciated.
Reply | Threaded
Open this post in threaded view
|

Re: Make TextEditor Widget Read-Only Programmatically

Josef Springer
Hi grovesr.

send the controller readOnly: true or
install a ReadOnlyTextEditorController as new controller for the widget. The Spec-installing procedure does this way.

Josef

grovesr wrote:
I am having trouble determining how to programmatically set a TextEditor
widget to be Read-Only. I want to do something like:
(self wrapperAt: #textEditor) makeReadOnly
I don't see a method that allows me to do that, but I see that I can create
the widget in the GUI Painter Read-Only, so I suspect that it can be done
later during program execution also.

Upon further search, I see that I can apply #isReadOnly: to the wrapper
spec:
(self wrapperAt: #textEditor) spec isReadOnly: true
But I'm not sure what I have to do to cause the #textEditor to pick up that
spec.
Any help would be greatly appreciated.

Reply | Threaded
Open this post in threaded view
|

Re: Make TextEditor Widget Read-Only Programmatically

grovesr

Hi Josef,
Sending readOnly: true  to the TextEditorController worked like a charm.  Thanks.

Regards, Rob Groves;  (Robert Groves/Fishkill/IBM)
[hidden email]
Voice: tie line 532-3993, outside line (845)892-3993
fax: tie line 532-6314, outside line (845)892-6314



Josef Springer <[hidden email]>

05/29/2007 09:29 AM

To
Robert Groves/Fishkill/IBM@IBMUS
cc
[hidden email]
Subject
Re: Make TextEditor Widget Read-Only Programmatically





Hi grovesr.

send the controller readOnly: true or
install a ReadOnlyTextEditorController as new controller for the widget. The Spec-installing procedure does this way.

Josef

grovesr wrote:

I am having trouble determining how to programmatically set a TextEditor
widget to be Read-Only.  I want to do something like:
(self wrapperAt: #textEditor) makeReadOnly
I don't see a method that allows me to do that, but I see that I can create
the widget in the GUI Painter Read-Only, so I suspect that it can be done
later during program execution also.

Upon further search, I see that I can apply #isReadOnly: to the wrapper
spec:
(self wrapperAt: #textEditor) spec isReadOnly: true
But I'm not sure what I have to do to cause the #textEditor to pick up that
spec.
Any help would be greatly appreciated.