[Pharo-project] TextMorph without being able to be edited?
Hi again, everyone! I think this might be really really silly, but I couldn't find a way to show a TextMorph without the ability to edit it's text. If I use a StringMorph to show a paragraph, it looks horrible, but if I use a TextMorph and click on it, a blue border appears and I'm able to edit the text, I don't want that to happen. Is there another morph for showing text that *only shows text* and nothing else? Or a property of TextMorph that I'm missing? Thanks! Carla
Carla, It's not silly when you can't figure out how to do it. Just glancing at some of my code, I think one approach is to use #newTextEditorFor:getText:setText:. The receiver is a TEasilyThemed user (StandardWindow is a good example). The first argument is the model, and the last two are selectors for message the model should understand. Give nil for the setter, and I *think* you will get what you want. If not, there will be some type of read-only flag to be set. Bill ________________________________________ From: pharo-project-bounces@lists.gforge.inria.fr [pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Carla F. Griggio [carla.griggio@gmail.com] Sent: Saturday, August 07, 2010 6:26 AM To: Pharo Development Subject: [Pharo-project] TextMorph without being able to be edited? Hi again, everyone! I think this might be really really silly, but I couldn't find a way to show a TextMorph without the ability to edit it's text. If I use a StringMorph to show a paragraph, it looks horrible, but if I use a TextMorph and click on it, a blue border appears and I'm able to edit the text, I don't want that to happen. Is there another morph for showing text that only shows text and nothing else? Or a property of TextMorph that I'm missing? Thanks! Carla
Try NewTextMorph! t := NewTextMorph new. t borderWidth: 1; borderColor: Color red; color: Color white; padding: 5 ; readOnly: true; autoFit: true ; text: 'I present my text as read only ' asText ; openInWorld. Fernando On Aug 7, 2010, at 12:26 PM, Carla F. Griggio wrote:
Hi again, everyone!
I think this might be really really silly, but I couldn't find a way to show a TextMorph without the ability to edit it's text. If I use a StringMorph to show a paragraph, it looks horrible, but if I use a TextMorph and click on it, a blue border appears and I'm able to edit the text, I don't want that to happen.
Is there another morph for showing text that only shows text and nothing else? Or a property of TextMorph that I'm missing?
Thanks! Carla <ATT00001..txt>
Yes! On Aug 9, 2010, at 11:07 AM, Fernando olivero wrote:
Try NewTextMorph!
t := NewTextMorph new. t borderWidth: 1; borderColor: Color red; color: Color white; padding: 5 ; readOnly: true; autoFit: true ; text: 'I present my text as read only ' asText ; openInWorld.
Fernando On Aug 7, 2010, at 12:26 PM, Carla F. Griggio wrote:
Hi again, everyone!
I think this might be really really silly, but I couldn't find a way to show a TextMorph without the ability to edit it's text. If I use a StringMorph to show a paragraph, it looks horrible, but if I use a TextMorph and click on it, a blue border appears and I'm able to edit the text, I don't want that to happen.
Is there another morph for showing text that only shows text and nothing else? Or a property of TextMorph that I'm missing?
Thanks! Carla <ATT00001..txt>
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
:D ! Great! Thanks. But it seems that a NewTextMorph doesn't understand autoFit: nor padding: :( I don't really care about the padding now, but I'd like to have this morph 'autofitted' :P How come that it works for you (Fernando) and not me? :S I found that if I send #fitToParagraph to the NewTextMorph instance after I set it's text, it fits OK. I still have to try Bill's suggestion. Thanks! Carla On Mon, Aug 9, 2010 at 6:27 AM, Stéphane Ducasse <stephane.ducasse@inria.fr>wrote:
Yes!
On Aug 9, 2010, at 11:07 AM, Fernando olivero wrote:
Try NewTextMorph!
t := NewTextMorph new. t borderWidth: 1; borderColor: Color red; color: Color white; padding: 5 ; readOnly: true; autoFit: true ; text: 'I present my text as read only ' asText ; openInWorld.
Fernando On Aug 7, 2010, at 12:26 PM, Carla F. Griggio wrote:
Hi again, everyone!
I think this might be really really silly, but I couldn't find a way to show a TextMorph without the ability to edit it's text. If I use a StringMorph to show a paragraph, it looks horrible, but if I use a TextMorph and click on it, a blue border appears and I'm able to edit the text, I don't want that to happen.
Is there another morph for showing text that only shows text and nothing else? Or a property of TextMorph that I'm missing?
Thanks! Carla <ATT00001..txt>
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Did you try in an updated 1.2 image? (Menu tools Software update) Please let me know, because is working fine for me in Gaucho, since a while now. And i'm using an updated 1.2 image. Saludos, Fernando On Aug 9, 2010, at 10:11 PM, Carla F. Griggio wrote:
:D ! Great! Thanks.
But it seems that a NewTextMorph doesn't understand autoFit: nor padding: :(
I don't really care about the padding now, but I'd like to have this morph 'autofitted' :P How come that it works for you (Fernando) and not me? :S I found that if I send #fitToParagraph to the NewTextMorph instance after I set it's text, it fits OK.
I still have to try Bill's suggestion.
Thanks! Carla
On Mon, Aug 9, 2010 at 6:27 AM, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote: Yes!
On Aug 9, 2010, at 11:07 AM, Fernando olivero wrote:
Try NewTextMorph!
t := NewTextMorph new. t borderWidth: 1; borderColor: Color red; color: Color white; padding: 5 ; readOnly: true; autoFit: true ; text: 'I present my text as read only ' asText ; openInWorld.
Fernando On Aug 7, 2010, at 12:26 PM, Carla F. Griggio wrote:
Hi again, everyone!
I think this might be really really silly, but I couldn't find a way to show a TextMorph without the ability to edit it's text. If I use a StringMorph to show a paragraph, it looks horrible, but if I use a TextMorph and click on it, a blue border appears and I'm able to edit the text, I don't want that to happen.
Is there another morph for showing text that only shows text and nothing else? Or a property of TextMorph that I'm missing?
Thanks! Carla <ATT00001..txt>
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
<ATT00001..txt>
Fernando, that works fine in an updated 1.2 image :) 2010/8/9 Fernando olivero <oliverof@lu.unisi.ch>
Did you try in an updated 1.2 image?
(Menu tools Software update)
Please let me know, because is working fine for me in Gaucho, since a while now. And i'm using an updated 1.2 image.
Saludos, Fernando
On Aug 9, 2010, at 10:11 PM, Carla F. Griggio wrote:
:D ! Great! Thanks.
But it seems that a NewTextMorph doesn't understand autoFit: nor padding: :(
I don't really care about the padding now, but I'd like to have this morph 'autofitted' :P How come that it works for you (Fernando) and not me? :S I found that if I send #fitToParagraph to the NewTextMorph instance after I set it's text, it fits OK.
I still have to try Bill's suggestion.
Thanks! Carla
On Mon, Aug 9, 2010 at 6:27 AM, Stéphane Ducasse < stephane.ducasse@inria.fr> wrote:
Yes!
On Aug 9, 2010, at 11:07 AM, Fernando olivero wrote:
Try NewTextMorph!
t := NewTextMorph new. t borderWidth: 1; borderColor: Color red; color: Color white; padding: 5 ; readOnly: true; autoFit: true ; text: 'I present my text as read only ' asText ; openInWorld.
Fernando On Aug 7, 2010, at 12:26 PM, Carla F. Griggio wrote:
Hi again, everyone!
I think this might be really really silly, but I couldn't find a way to show a TextMorph without the ability to edit it's text. If I use a StringMorph to show a paragraph, it looks horrible, but if I use a TextMorph and click on it, a blue border appears and I'm able to edit the text, I don't want that to happen.
Is there another morph for showing text that only shows text and nothing else? Or a property of TextMorph that I'm missing?
Thanks! Carla <ATT00001..txt>
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
<ATT00001..txt>
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
participants (4)
-
Carla F. Griggio -
Fernando olivero -
Schwab,Wilhelm K -
Stéphane Ducasse