How can the main window title in Squeak and Pharo be set?

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

How can the main window title in Squeak and Pharo be set?

Frank Church
How can the main window title in Squeak and Pharo be set?

In Pharo I thought it could be set in the System -> Settings Menu but
couldn't find anything there.

Can it be set only in code?


--
Frank Church

=======================
http://devblog.brahmancreations.com

Reply | Threaded
Open this post in threaded view
|

Re: How can the main window title in Squeak and Pharo be set?

EstebanLM
DisplayScreen hostWindowTitle: 'My Title'.


On Jan 10, 2013, at 5:40 PM, Frank Church <[hidden email]> wrote:

> How can the main window title in Squeak and Pharo be set?
>
> In Pharo I thought it could be set in the System -> Settings Menu but
> couldn't find anything there.
>
> Can it be set only in code?
>
>
> --
> Frank Church
>
> =======================
> http://devblog.brahmancreations.com
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] How can the main window title in Squeak and Pharo be set?

Bert Freudenberg
In reply to this post by Frank Church

On 10.01.2013, at 08:40, Frank Church <[hidden email]> wrote:

> How can the main window title in Squeak and Pharo be set?
>
> In Pharo I thought it could be set in the System -> Settings Menu but
> couldn't find anything there.
>
> Can it be set only in code?


Try this in Squeak:

        HostWindowProxy basicNew primitiveWindowTitle: 1 string: 'My Title' squeakToUtf8

In Etoys we have a convenience method for this:

        DisplayScreen hostWindowTitle: 'My Title'

(because Etoys shows the current project name as window title)

- Bert -


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] How can the main window title in Squeak and Pharo be set?

Frank Church
On 10 January 2013 18:56, Bert Freudenberg <[hidden email]> wrote:

> On 10.01.2013, at 10:39, Nicolas Cellier <[hidden email]> wrote:
>
>> Bert,
>> you can add the answer on SO too :)
>>
>> Nicolas
>
> Ok. Would be helpful if people linked to the Stack Overflow question if they ask by email, too.
>
> - Bert -
>
>

I have tried them both in Squeak 4.3 but they don't work.

DisplayScreen hostWindowTitle: 'My Title'.  -> hostWindowTitle Unknown
selector error.

HostWindowProxy basicNew primitiveWindowTitle: 1 string: 'My Title'
squeakToUtf8 -> results in Unknown variable HostWindowProxy

In Pharo:

DisplayScreen hostWindowTitle: 'My Title'. -> no error message but no effect.

HostWindowProxy basicNew primitiveWindowTitle: 1 string: 'My Title'
squeakToUtf8 -> MNU: ByteString >> squeakToUtf8

When I remove the squeakToUtf8 at the end - ie:

HostWindowProxy basicNew primitiveWindowTitle: 1 string: 'My Title' ->
Error: Unable to set title of Host Window

In fact that is the actual code in

primitiveWindowTitle: id string: titleString
"Set the label of the title bar of the window"
        <primitive: 'primitiveHostWindowTitle' module: 'HostWindowPlugin'>
        ^self error: 'Unable to set title of Host Window'

HostWindowProxy basicNew primitiveWindowTitle: 1 string: 'My Title'

--
Frank Church

=======================
http://devblog.brahmancreations.com