I am working in a Pharo 1.3 image and this works well for me.
ws := Workspace openLabel: 'my new workspace'.
ws toggleStylingActive.
ws contents: 'my new content'.
I like opening with a descriptive label rather than just adding another
"Workspace" window on my screen or on my tabs at the bottom. It helps to
identify and find.
I can refresh the contents with them remaining unstyled.
From my experiments I have discovered that toggling from a styled state
to an unstyled state is only successful if the contents are empty, ''.
Toggling from an unstyled state to a styled state is always successful.
I can do the below, executing each line at a time in sequence in a
Workspace and it behaves like the comments on each line.
r := Random new.
ws := Workspace openLabel: 'my new workspace'.
ws toggleStylingActive. " de-activates styling".
ws contents: '"', r next asString, '"'. " no styling as expected".
ws toggleStylingActive. " activates styling".
ws contents: '"', r next asString, '"'. " styling changes as expected".
ws toggleStylingActive. " de-activates styling".
ws contents: '"', r next asString, '"'. " styling did not change,
WHY??? ".
ws contents: ''.
ws contents: '"', r next asString, '"'. " styling changes"
ws toggleStylingActive. " activates styling".
ws contents: '"', r next asString, '"'. " styling changes".
Strange behavior.
Thanks for the information.
Jimmie
On 8/31/2011 3:45 PM, Stéphane Ducasse wrote:
In latest 1.4
wk := Workspace new.
wk contents: 'lkhkhkjhkjh'.
wk toggleStylingActive.
wk open
so I imagine easily that we can define a better creation method but this one is
working well.
Stef
On Aug 31, 2011, at 6:04 PM, Alexandre Bergel wrote:
hi!
Is there a way to open a text in a window in Pharo?
Doing: Workspace openContents: 'hello world'
shows
<Screen Shot 2011-08-31 at 13.03.06.png>
Is there a way to remove the syntax highlighting?
Cheers,
Alexandre
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.