how to center a workspace in the World ?

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

how to center a workspace in the World ?

Mariano Martinez Peck
How can I do that?  For the moment, I am doing:

openWelcomeWorkspace

    (Workspace new
    acceptContents: '  Welcome to pharo...blah blah

';
    embeddedInMorphicWindowLabeled: 'Welcome to Pharo')
    position: 50@120;
    extent: 800 @ 500;
   openAsIs


I want to keep the extent, but the position to be centered.

Thanks for any hint,

Mariano

_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: how to center a workspace in the World ?

Fernando olivero
morph := Morph new.
morph extent: 400@400.
centeredPosition := ( RealEstateAgent maximumUsableArea center - ( ( morph width /2) @ ( morph height /2) ) ) rounded .
morph position: centeredPosition.
morph openInWorld .


On May 20, 2010, at 1:31 PM, Mariano Martinez Peck wrote:

> How can I do that?  For the moment, I am doing:
>
> openWelcomeWorkspace
>
>     (Workspace new
>     acceptContents: '  Welcome to pharo...blah blah
>
> ';
>     embeddedInMorphicWindowLabeled: 'Welcome to Pharo')
>     position: 50@120;
>     extent: 800 @ 500;
>    openAsIs
>
>
> I want to keep the extent, but the position to be centered.
>
> Thanks for any hint,
>
> Mariano
> <ATT00001..txt>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: how to center a workspace in the World ?

Mariano Martinez Peck


On Thu, May 20, 2010 at 1:46 PM, Fernando olivero <[hidden email]> wrote:
morph := Morph new.
morph extent: 400@400.
centeredPosition := ( RealEstateAgent maximumUsableArea center - ( ( morph width /2) @ ( morph height /2) ) ) rounded .
morph position: centeredPosition.
morph openInWorld .


Thanks Fernando. I want to do that but for a Workspace. Workspace doesn't extend from Morph.

Cheers

Mariano


 

On May 20, 2010, at 1:31 PM, Mariano Martinez Peck wrote:

> How can I do that?  For the moment, I am doing:
>
> openWelcomeWorkspace
>
>     (Workspace new
>     acceptContents: '  Welcome to pharo...blah blah
>
> ';
>     embeddedInMorphicWindowLabeled: 'Welcome to Pharo')
>     position: 50@120;
>     extent: 800 @ 500;
>    openAsIs
>
>
> I want to keep the extent, but the position to be centered.
>
> Thanks for any hint,
>
> Mariano
> <ATT00001..txt>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Reply | Threaded
Open this post in threaded view
|

Re: how to center a workspace in the World ?

Fernando olivero
workspace := Workspace new.
workspace acceptContents: '  Welcome to pharo...blah blah'.
morph := workspace embeddedInMorphicWindowLabeled: 'Welcome to Pharo'.
morph extent: 800@500.
centeredPosition := ( RealEstateAgent maximumUsableArea center - ( ( morph width /2) @ ( morph height /2) ) ) rounded .
morph position: centeredPosition.
morph openAsIs .


On May 20, 2010, at 2:21 PM, Mariano Martinez Peck wrote:



On Thu, May 20, 2010 at 1:46 PM, Fernando olivero <[hidden email]> wrote:
morph := Morph new.
morph extent: 400@400.
centeredPosition := ( RealEstateAgent maximumUsableArea center - ( ( morph width /2) @ ( morph height /2) ) ) rounded .
morph position: centeredPosition.
morph openInWorld .


Thanks Fernando. I want to do that but for a Workspace. Workspace doesn't extend from Morph.

Cheers

Mariano


 

On May 20, 2010, at 1:31 PM, Mariano Martinez Peck wrote:

> How can I do that?  For the moment, I am doing:
>
> openWelcomeWorkspace
>
>     (Workspace new
>     acceptContents: '  Welcome to pharo...blah blah
>
> ';
>     embeddedInMorphicWindowLabeled: 'Welcome to Pharo')
>     position: 50@120;
>     extent: 800 @ 500;
>    openAsIs
>
>
> I want to keep the extent, but the position to be centered.
>
> Thanks for any hint,
>
> Mariano
> <ATT00001..txt>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

<ATT00001..txt>


_______________________________________________
Pharo-project mailing list
[hidden email]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project