On 24/08/15 20:41, Torsten Bergmann wrote:
Hi Julien,

try

  WorldMorph installNewWorld.

which will create a new world. Open a workspace and check that it is there.

  WorldMorph allInstances

If you click in the inspector you will see a morph representation of it - so you
see which one is which.

Now you have two instances of WorldMorph in your system. One is always connected
to the global variable

   World

You can switch as experiment by either:

    WorldMorph allInstances first install.
    Display restore

or

    WorldMorph allInstances last install.
    Display restore

The restore is necessary to update the drawing.

I think you get the idea from this. As I said - the pieces are there, someone
has to connect them.
Yes, I am exploring messages to see how to do it. I'll probably give a try tonight.

Thanks for these code snippets anyway :)
You dont have to thank me - it is good that you brought this into attention 
again
and if you could devote some time in helping to bring such a nice feature also 
(back)
to Pharo again.

In case of questions do not hesitate to ask on this list or the pharo-dev list.

Thanks
T.

Gesendet: Montag, 24. August 2015 um 20:31 Uhr
Von: "Julien Delplanque" <jul...@tamere.eu>
An: "Torsten Bergmann" <asta...@gmx.de>
Cc: "Any question about pharo is welcome" <pharo-users@lists.pharo.org>, "Stéphane Ducasse" 
<stephane.duca...@inria.fr>, "Marcus Denker" <marcus.den...@inria.fr>, s...@clipperadams.com
Betreff: Re: Multi desktops inside Pharo!

Thanks a lot for all these tips :)

I will update the project to match with what is really expected from a
multi world utility.

Thanks again for the time you take to explain me this.

Regards,
Julien

On 24/08/15 20:24, Torsten Bergmann wrote:
Hi Julien,

what I remember from history

   - Jochen F. Rick had a "JRWorldManager" implemented back in 2010
        - was discusssed here 
http://forum.world.st/Multiple-Worlds-was-Re-Can-I-use-Projects-in-Pharo-td2240869.html
        - code is here 
http://forum.world.st/attachment/2242195/0/JRWorldManager.st (basically 
something to manage the desktops)
   - then Sean picked up the idea in 2011 and implemented
        - blog post http://seandenigris.com/blog/?p=767
        - he provided "MultipleWorlds.2.cs" which I think is lost during 
bugtracker transition
   - later default Pharo image was reworked for the world to have WorldMorph 
instances instead of Squeaks PasteUpMorph, so
     the code of Sean and Jochen would be obsolete anyway

Some tips:
==========
   - Pharo has a global called "World" which is pointing to the current world 
of displayed morphs, you need to
     switch this and handle/manage new Worlds = Desktops.
   - in older Pharo versions and Squeak this was a PasteUpMorph, now it is an instance of 
class "WorldMorph"
   - note that there is a class side method "installNewWorld" with the nice comment 
"let us play God."
   - basically you already have the parts with a DeskopManager and the switch 
via keyboard, you just need
     to play with #installNewWorld and #install method of the worlds
     Note: check the comments of the class and methods in WorldMorph - this 
might be subject to change
   - to get a thumbnail form of the world you can use:

      |sizeFactor|
      sizeFactor := 0.3.
      World taskThumbnailOfSize: (Display width * sizeFactor) @ (Display height 
* sizeFactor)

   - see how the preview is handled in TaskListMorph 
newPreviewMorph/updatePreview methods to get an idea

So all the pieces of the puzzle are there - just connect them correctly.
Side Note: default Pharo image has the possibility to put an external picture somewhere that is used
             by the theme as the background image. Cant remember where it is - just 
browser for "background..."
             methods in the Finder. With multiple desktops I guess this needs 
some love as well to have
             a backgorund per desktop.

Hope that helps!

Bye
Torsten

Gesendet: Montag, 24. August 2015 um 19:46 Uhr
Von: "Julien Delplanque" <jul...@tamere.eu>
An: "Torsten Bergmann" <asta...@gmx.de>, "Any question about pharo is welcome" <pharo-users@lists.pharo.org>, 
"Stéphane Ducasse" <stephane.duca...@inria.fr>, "Marcus Denker" <marcus.den...@inria.fr>, s...@clipperadams.com
Betreff: Re: Multi desktops inside Pharo!



On 24/08/15 19:32, Torsten Bergmann wrote:
Julien Delplanque wrote:
I created a small utility that make possible to have multi desktops:
https://github.com/juliendelplanque/desktopsmanager.
Your code works for me in Pharo 5, havent tried in Pharo 4.

Unfortunately it does only work for Pharo "windows" but not general morphs.
If you evaluate

     ElipseMorph new openInWorld

and hit CTRL+SHIFT+J you will see that the morph stays on the desktop.
So your goodie is a "window switcher" and not a "desktop switcher".
Yes you are right. But it is a first step, I planned to really create
"new desktops" in the future, but for now I wrote this fast to have
something usable.
I guess it would be better if you would really switch the WorldMorph instance
referenced by the global "World" variable.

There already was a solutions once discussed/contributed with code here

     http://forum.world.st/Multiple-Worlds-for-Pharo-stable-td3233552.html
     http://seandenigris.com/blog/?p=767

I think it got lost in the old bugtracker. Maybe Sean (who wrote it) can help 
here,
update the code and merge with yours.
Yes I'm OK to do that. Where can I find this package?
Ideally such a "Switch desktop" possibility would be part of the
standard Pharo 5 image including a small preview of the whole desktop
similar to what usual operating system window manager do and the possibility
to provide different backgrounds to the desktops.
It would be really nice to have multiple world by default in pharo images :)
Thanks
Torsten
Julien





Reply via email to