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

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
13 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?

Bert Freudenberg

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: How can the main window title in Squeak and Pharo be set?

Nicolas Cellier
Bert,
you can add the answer on SO too :)

Nicolas

2013/1/10 Bert Freudenberg <[hidden email]>:

>
> 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: How can the main window title in Squeak and Pharo be set?

Bert Freudenberg
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 -


Reply | Threaded
Open this post in threaded view
|

Re: 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

Reply | Threaded
Open this post in threaded view
|

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

Ron Teitelbaum
Hi Frank,

This might be really dumb but I set the window title in the ini file.  

In Squeak.ini

WindowTitle=Terf.

Are you only trying to change the title while running?


All the best,

Ron Teitelbaum
Head Of Engineering
3d Immersive Collaboration Consulting
[hidden email]
Follow Me On Twitter: @RonTeitelbaum
www.3dicc.com




> -----Original Message-----
> From: [hidden email] [mailto:squeak-dev-
> [hidden email]] On Behalf Of Frank Church
> Sent: Thursday, January 10, 2013 8:27 PM
> To: The general-purpose Squeak developers list; A friendly place where any
> question about pharo is welcome
> Subject: Re: [squeak-dev] How can the main window title in Squeak and
Pharo
> be set?
>
> 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
>



Reply | Threaded
Open this post in threaded view
|

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

timrowledge

On 10-01-2013, at 6:07 PM, "Ron Teitelbaum" <[hidden email]> wrote:

> Hi Frank,
>
> This might be really dumb but I set the window title in the ini file.  

That's a way of doing it permanently; there's a similar option in the RISC OS !run file.

The HostWindow stuff depends on there being an actual HostWindowPlugin installed that functions. I know it's there for RISC OS. I know it's likely there for Mac. I think it's there for Windows; I'm fairly sure it isn't for unix.


tim
--
tim Rowledge; [hidden email]; http://www.rowledge.org/tim
Strange OpCodes: MTP: MounT Programmer



Reply | Threaded
Open this post in threaded view
|

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

Bert Freudenberg

On 10.01.2013, at 18:18, tim Rowledge <[hidden email]> wrote:

>
> On 10-01-2013, at 6:07 PM, "Ron Teitelbaum" <[hidden email]> wrote:
>
>> Hi Frank,
>>
>> This might be really dumb but I set the window title in the ini file.  
>
> That's a way of doing it permanently; there's a similar option in the RISC OS !run file.

There is no such option on the Mac or in the Unix VM.

> The HostWindow stuff depends on there being an actual HostWindowPlugin installed that functions. I know it's there for RISC OS. I know it's likely there for Mac. I think it's there for Windows; I'm fairly sure it isn't for unix.


For Unix (X11 specifically) there is just enough HostWindowPlugin stuff implemented to be able to change the title and size of the main window. The multi-window stuff is there as stubs.

- Bert -



Reply | Threaded
Open this post in threaded view
|

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

Ron Teitelbaum
Hi All,

We change the window title on Windows and Mac so I looked it up.

We use:

Smalltalk windowLabel: 'Terf'

Doesn't seem to be in Squeak 4.3  but the included HostWindowPlugin appears
to support it.

I added Andreas' code to Squeak 4.3 and it worked on Windows.  It probably
works on Mac, doubt it works on Linux.

SmalltalkImage >> windowLabel: aString
        "Set the window label for the main Squeak window"
        ^self primitiveWindowLabel: (aString ifNil:[''] ifNotNil:[aString
squeakToUtf8])

SmalltalkImage >> primitiveWindowLabel: aString
        "Set the window label for the main Squeak window"
        <primitive: 'primitiveSetWindowLabel'>
        ^nil

Hope that helps.

All the best,

Ron Teitelbaum
Head Of Engineering
3d Immersive Collaboration Consulting
[hidden email]
Follow Me On Twitter: @RonTeitelbaum
www.3dicc.com




> -----Original Message-----
> From: [hidden email] [mailto:squeak-dev-
> [hidden email]] On Behalf Of Bert Freudenberg
> Sent: Thursday, January 10, 2013 10:16 PM
> To: The general-purpose Squeak developers list
> Subject: Re: [squeak-dev] How can the main window title in Squeak and
Pharo

> be set?
>
>
> On 10.01.2013, at 18:18, tim Rowledge <[hidden email]> wrote:
>
> >
> > On 10-01-2013, at 6:07 PM, "Ron Teitelbaum" <[hidden email]> wrote:
> >
> >> Hi Frank,
> >>
> >> This might be really dumb but I set the window title in the ini file.
> >
> > That's a way of doing it permanently; there's a similar option in the
RISC OS
> !run file.
>
> There is no such option on the Mac or in the Unix VM.
>
> > The HostWindow stuff depends on there being an actual HostWindowPlugin
> installed that functions. I know it's there for RISC OS. I know it's
likely there for
> Mac. I think it's there for Windows; I'm fairly sure it isn't for unix.
>
>
> For Unix (X11 specifically) there is just enough HostWindowPlugin stuff
> implemented to be able to change the title and size of the main window.
The
> multi-window stuff is there as stubs.
>
> - Bert -
>
>
>



Reply | Threaded
Open this post in threaded view
|

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

Bert Freudenberg

On 10.01.2013, at 20:41, "Ron Teitelbaum" <[hidden email]> wrote:

> Hi All,
>
> We change the window title on Windows and Mac so I looked it up.
>
> We use:
>
> Smalltalk windowLabel: 'Terf'
>
> Doesn't seem to be in Squeak 4.3  but the included HostWindowPlugin appears
> to support it.

This is yet another primitive, independent of HostWindowPlugin.

> I added Andreas' code to Squeak 4.3 and it worked on Windows.  It probably
> works on Mac, doubt it works on Linux.

Works on Eliot's Mac VM, yes. Does it work in the Windows interpreter VM?

- Bert -

>
> SmalltalkImage >> windowLabel: aString
> "Set the window label for the main Squeak window"
> ^self primitiveWindowLabel: (aString ifNil:[''] ifNotNil:[aString
> squeakToUtf8])
>
> SmalltalkImage >> primitiveWindowLabel: aString
> "Set the window label for the main Squeak window"
> <primitive: 'primitiveSetWindowLabel'>
> ^nil
>
> Hope that helps.
>
> All the best,
>
> Ron Teitelbaum
> Head Of Engineering
> 3d Immersive Collaboration Consulting
> [hidden email]
> Follow Me On Twitter: @RonTeitelbaum
> www.3dicc.com
>
>
>
>
>> -----Original Message-----
>> From: [hidden email] [mailto:squeak-dev-
>> [hidden email]] On Behalf Of Bert Freudenberg
>> Sent: Thursday, January 10, 2013 10:16 PM
>> To: The general-purpose Squeak developers list
>> Subject: Re: [squeak-dev] How can the main window title in Squeak and
> Pharo
>> be set?
>>
>>
>> On 10.01.2013, at 18:18, tim Rowledge <[hidden email]> wrote:
>>
>>>
>>> On 10-01-2013, at 6:07 PM, "Ron Teitelbaum" <[hidden email]> wrote:
>>>
>>>> Hi Frank,
>>>>
>>>> This might be really dumb but I set the window title in the ini file.
>>>
>>> That's a way of doing it permanently; there's a similar option in the
> RISC OS
>> !run file.
>>
>> There is no such option on the Mac or in the Unix VM.
>>
>>> The HostWindow stuff depends on there being an actual HostWindowPlugin
>> installed that functions. I know it's there for RISC OS. I know it's
> likely there for
>> Mac. I think it's there for Windows; I'm fairly sure it isn't for unix.
>>
>>
>> For Unix (X11 specifically) there is just enough HostWindowPlugin stuff
>> implemented to be able to change the title and size of the main window.
> The
>> multi-window stuff is there as stubs.
>>
>> - Bert -
>>
>>
>>
>
>
>

- Bert -



Reply | Threaded
Open this post in threaded view
|

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

Hannes Hirzel
Note aside: Because of these problems I'd like to have an All-In-One
download with VMs which have the necessary host window plugins
installed (not necessarily now, but in a few months time....)

--Hannes

On 1/11/13, Bert Freudenberg <[hidden email]> wrote:

>
> On 10.01.2013, at 20:41, "Ron Teitelbaum" <[hidden email]> wrote:
>
>> Hi All,
>>
>> We change the window title on Windows and Mac so I looked it up.
>>
>> We use:
>>
>> Smalltalk windowLabel: 'Terf'
>>
>> Doesn't seem to be in Squeak 4.3  but the included HostWindowPlugin
>> appears
>> to support it.
>
> This is yet another primitive, independent of HostWindowPlugin.
>
>> I added Andreas' code to Squeak 4.3 and it worked on Windows.  It
>> probably
>> works on Mac, doubt it works on Linux.
>
> Works on Eliot's Mac VM, yes. Does it work in the Windows interpreter VM?
>
> - Bert -
>
>>
>> SmalltalkImage >> windowLabel: aString
>> "Set the window label for the main Squeak window"
>> ^self primitiveWindowLabel: (aString ifNil:[''] ifNotNil:[aString
>> squeakToUtf8])
>>
>> SmalltalkImage >> primitiveWindowLabel: aString
>> "Set the window label for the main Squeak window"
>> <primitive: 'primitiveSetWindowLabel'>
>> ^nil
>>
>> Hope that helps.
>>
>> All the best,
>>
>> Ron Teitelbaum
>> Head Of Engineering
>> 3d Immersive Collaboration Consulting
>> [hidden email]
>> Follow Me On Twitter: @RonTeitelbaum
>> www.3dicc.com
>>
>>
>>
>>
>>> -----Original Message-----
>>> From: [hidden email] [mailto:squeak-dev-
>>> [hidden email]] On Behalf Of Bert Freudenberg
>>> Sent: Thursday, January 10, 2013 10:16 PM
>>> To: The general-purpose Squeak developers list
>>> Subject: Re: [squeak-dev] How can the main window title in Squeak and
>> Pharo
>>> be set?
>>>
>>>
>>> On 10.01.2013, at 18:18, tim Rowledge <[hidden email]> wrote:
>>>
>>>>
>>>> On 10-01-2013, at 6:07 PM, "Ron Teitelbaum" <[hidden email]> wrote:
>>>>
>>>>> Hi Frank,
>>>>>
>>>>> This might be really dumb but I set the window title in the ini file.
>>>>
>>>> That's a way of doing it permanently; there's a similar option in the
>> RISC OS
>>> !run file.
>>>
>>> There is no such option on the Mac or in the Unix VM.
>>>
>>>> The HostWindow stuff depends on there being an actual HostWindowPlugin
>>> installed that functions. I know it's there for RISC OS. I know it's
>> likely there for
>>> Mac. I think it's there for Windows; I'm fairly sure it isn't for unix.
>>>
>>>
>>> For Unix (X11 specifically) there is just enough HostWindowPlugin stuff
>>> implemented to be able to change the title and size of the main window.
>> The
>>> multi-window stuff is there as stubs.
>>>
>>> - Bert -
>>>
>>>
>>>
>>
>>
>>
>
> - Bert -
>
>
>
>

Reply | Threaded
Open this post in threaded view
|

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

David T. Lewis
In reply to this post by Bert Freudenberg
On Thu, Jan 10, 2013 at 09:15:58PM -0800, Bert Freudenberg wrote:

>
> On 10.01.2013, at 20:41, "Ron Teitelbaum" <[hidden email]> wrote:
>
> > Hi All,
> >
> > We change the window title on Windows and Mac so I looked it up.
> >
> > We use:
> >
> > Smalltalk windowLabel: 'Terf'
> >
> > Doesn't seem to be in Squeak 4.3  but the included HostWindowPlugin appears
> > to support it.
>
> This is yet another primitive, independent of HostWindowPlugin.
>
> > I added Andreas' code to Squeak 4.3 and it worked on Windows.  It probably
> > works on Mac, doubt it works on Linux.
>
> Works on Eliot's Mac VM, yes. Does it work in the Windows interpreter VM?
>
> - Bert -

The alternative #primitiveSetWindowLabel is in the Cog branch only, and
therefore is not be present in any of the interpreter VMs.

I can't recall if this was ever discussed on the vm-dev list, but I know
that adding the primitive would require platform source changes for unix,
Windows, Mac, and RiscOS. Somebody would need to actively make that happen.
IMHO this is function is something better implemented in a plugin than
in the main interpreter anyway, so I would prefer to just use the primitive
that is already available in HostWindowPlugin.

Dave

>
> >
> > SmalltalkImage >> windowLabel: aString
> > "Set the window label for the main Squeak window"
> > ^self primitiveWindowLabel: (aString ifNil:[''] ifNotNil:[aString
> > squeakToUtf8])
> >
> > SmalltalkImage >> primitiveWindowLabel: aString
> > "Set the window label for the main Squeak window"
> > <primitive: 'primitiveSetWindowLabel'>
> > ^nil
> >
> > Hope that helps.
> >
> > All the best,
> >
> > Ron Teitelbaum
> > Head Of Engineering
> > 3d Immersive Collaboration Consulting
> > [hidden email]
> > Follow Me On Twitter: @RonTeitelbaum
> > www.3dicc.com
> >
> >
> >
> >
> >> -----Original Message-----
> >> From: [hidden email] [mailto:squeak-dev-
> >> [hidden email]] On Behalf Of Bert Freudenberg
> >> Sent: Thursday, January 10, 2013 10:16 PM
> >> To: The general-purpose Squeak developers list
> >> Subject: Re: [squeak-dev] How can the main window title in Squeak and
> > Pharo
> >> be set?
> >>
> >>
> >> On 10.01.2013, at 18:18, tim Rowledge <[hidden email]> wrote:
> >>
> >>>
> >>> On 10-01-2013, at 6:07 PM, "Ron Teitelbaum" <[hidden email]> wrote:
> >>>
> >>>> Hi Frank,
> >>>>
> >>>> This might be really dumb but I set the window title in the ini file.
> >>>
> >>> That's a way of doing it permanently; there's a similar option in the
> > RISC OS
> >> !run file.
> >>
> >> There is no such option on the Mac or in the Unix VM.
> >>
> >>> The HostWindow stuff depends on there being an actual HostWindowPlugin
> >> installed that functions. I know it's there for RISC OS. I know it's
> > likely there for
> >> Mac. I think it's there for Windows; I'm fairly sure it isn't for unix.
> >>
> >>
> >> For Unix (X11 specifically) there is just enough HostWindowPlugin stuff
> >> implemented to be able to change the title and size of the main window.
> > The
> >> multi-window stuff is there as stubs.
> >>
> >> - Bert -
> >>
> >>
> >>
> >
> >
> >
>
> - Bert -
>
>

Reply | Threaded
Open this post in threaded view
|

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

Bert Freudenberg
On 11.01.2013, at 05:45, "David T. Lewis" <[hidden email]> wrote:

> On Thu, Jan 10, 2013 at 09:15:58PM -0800, Bert Freudenberg wrote:
>>
>> On 10.01.2013, at 20:41, "Ron Teitelbaum" <[hidden email]> wrote:
>>
>>> Hi All,
>>>
>>> We change the window title on Windows and Mac so I looked it up.
>>>
>>> We use:
>>>
>>> Smalltalk windowLabel: 'Terf'
>>>
>>> Doesn't seem to be in Squeak 4.3  but the included HostWindowPlugin appears
>>> to support it.
>>
>> This is yet another primitive, independent of HostWindowPlugin.
>>
>>> I added Andreas' code to Squeak 4.3 and it worked on Windows.  It probably
>>> works on Mac, doubt it works on Linux.
>>
>> Works on Eliot's Mac VM, yes. Does it work in the Windows interpreter VM?
>>
>> - Bert -
>
> The alternative #primitiveSetWindowLabel is in the Cog branch only, and
> therefore is not be present in any of the interpreter VMs.
>
> I can't recall if this was ever discussed on the vm-dev list, but I know
> that adding the primitive would require platform source changes for unix,
> Windows, Mac, and RiscOS. Somebody would need to actively make that happen.
> IMHO this is function is something better implemented in a plugin than
> in the main interpreter anyway, so I would prefer to just use the primitive
> that is already available in HostWindowPlugin.
>
> Dave

+1

- Bert -

>>
>>>
>>> SmalltalkImage >> windowLabel: aString
>>> "Set the window label for the main Squeak window"
>>> ^self primitiveWindowLabel: (aString ifNil:[''] ifNotNil:[aString
>>> squeakToUtf8])
>>>
>>> SmalltalkImage >> primitiveWindowLabel: aString
>>> "Set the window label for the main Squeak window"
>>> <primitive: 'primitiveSetWindowLabel'>
>>> ^nil
>>>
>>> Hope that helps.
>>>
>>> All the best,
>>>
>>> Ron Teitelbaum
>>> Head Of Engineering
>>> 3d Immersive Collaboration Consulting
>>> [hidden email]
>>> Follow Me On Twitter: @RonTeitelbaum
>>> www.3dicc.com
>>>
>>>
>>>
>>>
>>>> -----Original Message-----
>>>> From: [hidden email] [mailto:squeak-dev-
>>>> [hidden email]] On Behalf Of Bert Freudenberg
>>>> Sent: Thursday, January 10, 2013 10:16 PM
>>>> To: The general-purpose Squeak developers list
>>>> Subject: Re: [squeak-dev] How can the main window title in Squeak and
>>> Pharo
>>>> be set?
>>>>
>>>>
>>>> On 10.01.2013, at 18:18, tim Rowledge <[hidden email]> wrote:
>>>>
>>>>>
>>>>> On 10-01-2013, at 6:07 PM, "Ron Teitelbaum" <[hidden email]> wrote:
>>>>>
>>>>>> Hi Frank,
>>>>>>
>>>>>> This might be really dumb but I set the window title in the ini file.
>>>>>
>>>>> That's a way of doing it permanently; there's a similar option in the
>>> RISC OS
>>>> !run file.
>>>>
>>>> There is no such option on the Mac or in the Unix VM.
>>>>
>>>>> The HostWindow stuff depends on there being an actual HostWindowPlugin
>>>> installed that functions. I know it's there for RISC OS. I know it's
>>> likely there for
>>>> Mac. I think it's there for Windows; I'm fairly sure it isn't for unix.
>>>>
>>>>
>>>> For Unix (X11 specifically) there is just enough HostWindowPlugin stuff
>>>> implemented to be able to change the title and size of the main window.
>>> The
>>>> multi-window stuff is there as stubs.
>>>>
>>>> - Bert -
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>
>> - Bert -
>>
>>
>