I have a class of my own which is a subclass of TextMorph. When I select all the text and change the font with command-k it visibly works. Now I am trying to find where this is recorded using the morph explorer, and I can't find it. (This is under Squeak 3.6.) Now, it's clear the explorer is hiding things from me. E.g. when I open up text in the explorer, it does not show me the instance variable runs, but if inspect text it does.
What actual method is being applied when I make a font change with command-k? I need to be able to recover enough to generate a snippet of Smalltalk code to be able to recreate the font change.
-Thanks, Jim
Hi Jim,
That kind of keyboard shortcuts are part of the ParagraphEditor class. And if you look at ParagraphEditor class side methods you will find the keyboard shortcuts maps.
About cmd+k you will find that the method that gets executed is ParagraphEditor>>offerFontMenu:.
Also note that the font selection is not part of TextMorph but of Text. To change a font use TextFontChange attribute and apply it on your Text instance. (This is the same with color, emphasis and other text attributes)
Regards, HernĂ¡n
Jim Rosenberg wrote:
I have a class of my own which is a subclass of TextMorph. When I select all the text and change the font with command-k it visibly works. Now I am trying to find where this is recorded using the morph explorer, and I can't find it. (This is under Squeak 3.6.) Now, it's clear the explorer is hiding things from me. E.g. when I open up text in the explorer, it does not show me the instance variable runs, but if inspect text it does.
What actual method is being applied when I make a font change with command-k? I need to be able to recover enough to generate a snippet of Smalltalk code to be able to recreate the font change.
-Thanks, Jim
___________________________________________________________ 1GB gratis, Antivirus y Antispam Correo Yahoo!, el mejor correo web del mundo http://correo.yahoo.com.ar
Also note that the font selection is not part of TextMorph but of Text. To change a font use TextFontChange attribute and apply it on your Text instance. (This is the same with color, emphasis and other text attributes)
Then, why can't I see it when I open up (or inspect) the text using the explorer? I'm going back to the morph "after the fact" with a piece of code, and I need to "retrieve" the name of the font it's been changed to. I don't know where to find it ...
-Thanks, Jim
I wrote:
Then, why can't I see it when I open up (or inspect) the text using the explorer? I'm going back to the morph "after the fact" with a piece of code, and I need to "retrieve" the name of the font it's been changed to. I don't know where to find it ...
OK, I see where to see it now. If I apply to a text morph
self text runs values explore
*now* I can drill down and see the name of my font.
It looks to me as though the object explorer is still broken under 3.8 in showing runs for a text. Hope somebody will fix this sometime ...
squeak-dev@lists.squeakfoundation.org