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 _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
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: [hidden email] [[hidden email]] On Behalf Of Carla F. Griggio [[hidden email]] 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 _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
In reply to this post by Carla F. Griggio
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! _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
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 > [hidden email] > http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project _______________________________________________ Pharo-project mailing list [hidden email] 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 <[hidden email]> wrote: Yes! _______________________________________________ Pharo-project mailing list [hidden email] 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. _______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Fernando, that works fine in an updated 1.2 image :)
2010/8/9 Fernando olivero <[hidden email]>
_______________________________________________ Pharo-project mailing list [hidden email] http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project |
Free forum by Nabble | Edit this page |