How do I display a text in a text window?

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

How do I display a text in a text window?

Hannes Hirzel
Hello

I want to display a string (no code)  in a text window.

What is the equivalent of the Squeak expression

    StringHolder
         new textContents: (MyTextCollection at: 101);
         openLabel: 'theText 101'

in Pharo 5.0?

Regards

Hannes

Reply | Threaded
Open this post in threaded view
|

Re: How do I display a text in a text window?

Hannes Hirzel
Answer:

To open a text window with text I do

     Workspace openContents: (MyTextCollection at: 101).


Display as text only:

At the bottom I can switch between

- plain text
- smalltalk scripting

But the text remains red in both cases.

What am I missing?

--Hannes

On 9/1/16, H. Hirzel <[hidden email]> wrote:

> Hello
>
> I want to display a string (no code)  in a text window.
>
> What is the equivalent of the Squeak expression
>
>     StringHolder
>          new textContents: (MyTextCollection at: 101);
>          openLabel: 'theText 101'
>
> in Pharo 5.0?
>
> Regards
>
> Hannes
>

Reply | Threaded
Open this post in threaded view
|

Re: How do I display a text in a text window?

stepharo
In reply to this post by Hannes Hirzel
Look into UIManager helpers.

I have to run now.


Le 1/9/16 à 21:47, H. Hirzel a écrit :

> Hello
>
> I want to display a string (no code)  in a text window.
>
> What is the equivalent of the Squeak expression
>
>      StringHolder
>           new textContents: (MyTextCollection at: 101);
>           openLabel: 'theText 101'
>
> in Pharo 5.0?
>
> Regards
>
> Hannes
>
>


Reply | Threaded
Open this post in threaded view
|

Re: How do I display a text in a text window?

Hannes Hirzel
Thank you Stephane for the hint.

Through reading

    UIManager createPageTestWorkspace

I found

    UIManager default  edit: (MyTextCollection at: 101)  label: 'Text 101'.

It works fine for my purpose.

--Hannes

On 9/2/16, stepharo <[hidden email]> wrote:

> Look into UIManager helpers.
>
> I have to run now.
>
>
> Le 1/9/16 à 21:47, H. Hirzel a écrit :
>> Hello
>>
>> I want to display a string (no code)  in a text window.
>>
>> What is the equivalent of the Squeak expression
>>
>>      StringHolder
>>           new textContents: (MyTextCollection at: 101);
>>           openLabel: 'theText 101'
>>
>> in Pharo 5.0?
>>
>> Regards
>>
>> Hannes
>>
>>
>
>
>