[Pharo-project] Tiling windows

Gastón Dall' Oglio gaston.dalloglio at gmail.com
Mon May 23 16:48:59 EDT 2011


Sorry Mariano, I omitted to say that I tried this on a one-click image
1.2.1, but still is not the code so try to share with you but the idea of
separating the types of windows, which I found very useful when I have many
windows.

2011/5/23 Mariano Martinez Peck <marianopeck at gmail.com>

> Be careful, in 1.3 it hangs my image and I was forced to kill it.
>
> 2011/5/23 Gastón Dall' Oglio <gaston.dalloglio at gmail.com>
>
>> Laurent, I attached a package I've added some improvements to your work, I
>> have found useful. Of course I am not knowledgeable about morph, just added
>> some and perhaps can serve as inspiration.
>>
>>
>> 2011/5/23 laurent laffont <laurent.laffont at gmail.com>
>>
>>> On 1.2:
>>>
>>> Gofer it
>>> squeaksource: 'LaurentLSandbox';
>>> version: 'Polymorph-Widgets-LaurentLaffont.388';
>>>  load.
>>>
>>>
>>> Then open or move a window so the TaskBar is updated and you have a new
>>> "magic" button on bottom left.
>>>
>>> (note this is hacky actually, I will write a nicer version this week if
>>> people like it).
>>>
>>> Laurent.
>>>
>>> On Mon, May 23, 2011 at 9:06 AM, Stéphane Ducasse <
>>> stephane.ducasse at inria.fr> wrote:
>>>
>>>> send a cs that we can play with it :)
>>>>
>>>> On May 22, 2011, at 8:25 PM, laurent laffont wrote:
>>>>
>>>> > Hi,
>>>> >
>>>> > what do you think of adding this in Pharo ?
>>>> >
>>>> > |taskbar tileWindowsBlock|
>>>> >
>>>> > tileWindowsBlock := [
>>>> >   |windows numberOfColumns numberOfRows windowWidth windowHeight|
>>>> >   windows := (World submorphs select: [:m| m isSystemWindow and: [m
>>>> isNotMinimized]]) asOrderedCollection.
>>>> >   numberOfColumns := windows size sqrtFloor.
>>>> >   numberOfRows := (windows size / numberOfColumns) rounded.
>>>> >   windowWidth := World width // numberOfColumns..
>>>> >   windowHeight := World height  - taskbar height // numberOfRows.
>>>> >
>>>> >   Matrix
>>>> >     rows: numberOfRows
>>>> >     columns: numberOfColumns
>>>> >     tabulate: [:row :column|  |window|
>>>> >           windows ifNotEmpty: [
>>>> >               window := windows remove: windows first.
>>>> >               window
>>>> >               bounds: (
>>>> >                   ((column - 1 * windowWidth) @ (row - 1 *
>>>> windowHeight))
>>>> >                   extent: (windowWidth) @  windowHeight)
>>>> >           ]
>>>> >     ]
>>>> > ].
>>>> >
>>>> >
>>>> > taskbar := (World submorphs detect: [:m| m isTaskbar]).
>>>> >
>>>> > taskbar
>>>> >   addMorph: (IconicButton new
>>>> >             target: tileWindowsBlock;
>>>> >             actionSelector: #value;
>>>> >             labelGraphic: taskbar theme smallWindowIcon;
>>>> >             color: Color transparent;
>>>> >             yourself).
>>>> >
>>>> >
>>>> > Laurent Laffont - @lolgzs
>>>> >
>>>> > Pharo Smalltalk Screencasts: http://www.pharocasts.com/
>>>> > Blog: http://magaloma.blogspot.com/
>>>> > Developer group: http://cara74.seasidehosting.st
>>>> >
>>>>
>>>>
>>>>
>>>
>>
>
>
> --
> Mariano
> http://marianopeck.wordpress.com
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pharo.org/pipermail/pharo-dev_lists.pharo.org/attachments/20110523/a7c8263d/attachment.html>


More information about the Pharo-dev mailing list