[OT] Two hacks with EToys

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

[OT] Two hacks with EToys

Javier Diaz-Reinoso
I known the etoys is almost dead in squeak (and really dead in pharo), but sometimes I need some quick tools like this:

- Histogram window with cursor:

        |form1 world gm w window|
        form1 := Form fromUser asGrayScale.
        world := PasteUpMorph new. world extent: 300@100.
        gm := GraphMorph new.
        gm data: form1 tallyPixelValues.
        world addMorph: gm.
        gm assuredPlayer.
        w := WatcherWrapper new.
        w unlabeledForPlayer: (gm player) getter: #getCursor.
        "w fancyForPlayer: (gm player) getter: #getCursor."
        w position: 150@90.
        world addMorph: w.
        w := WatcherWrapper new.
        w unlabeledForPlayer: (gm player) getter: #getSampleAtCursor.
        w position: 150@125.
        world addMorph: w.

        window:= SystemWindow new. window setLabel: 'Histogram'.
        window addMorph: world  frame: (0@0 corner: 1@1).
        window openInWorld; bounds: (100@100 corner: 475@300).

that is creating etoy widget programatically.

- MagnifierMorph with info, like Pixie in Mac OS X:

1.- open viewer for a MagnifierMorph
2.- create variable xy as default Number
3.- create variables rgb and hsb as String, perhaps you need to put the Preference allowEtoyUserCustomEvents to true before you can change the type to String (code rust).
4.- create a textual script with:

pixie
        |col|
        self setXy: (self costume) sourcePoint.
        col := (Display colorAt: (self getXy)).
        self setRgb: (col red * 255) asInteger asString, ' ', (col green * 255) asInteger asString, ' ', (col blue * 255) asInteger asString.
        self setHsb: (col hue printShowingDecimalPlaces:0),' ', (col saturation * 255) asInteger asString, ' ', (col brightness *255)  asInteger asString.

5.- create 3 viewers for the variables and run the script:



Note that Pixie don't show the Hue as 0-360 degrees instead show as a byte value, Pages show the radius correct but the saturation and brightness are show as percent instead of bytes.
There is some bugs, for example try to put the cursor in  the green arrows.



lupa.jpg (27K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: [OT] Two hacks with EToys

David T. Lewis
On Mon, May 09, 2011 at 06:57:48PM -0500, Javier D?az Reinoso wrote:
> I known the etoys is almost dead in squeak (and really dead in pharo), but sometimes I need some quick tools like this:

Cool!

And of course Etoys is not dead at all, but it could use a little love.
I think that many people on this list are looking for ways to contribute
to Squeak, and working on updating Squeak for better Etoys support would
certainly be one of them. Remember, for every developer working with
Squeak or Pharo there might be another million kids using Etoys who would
appreciate your help.

If we can make progress getting Etoys to work without problems on Squeak
trunk, and of course to make it a fully unloadable/reloadable package,
then millions of kids (and quite a few big kids too) can take advantage
of the latest improvements in Squeak as well as the speed improvements
of the high-performance Cog VM. That should make Etoys much faster and
better for everyone.

Dave


Reply | Threaded
Open this post in threaded view
|

Re: [OT] Two hacks with EToys

Gary Dunn-2

1++

Gary Dunn
Open Slate Project
http://openslate.org

On May 9, 2011 4:13 PM, "David T. Lewis" <[hidden email]> wrote:

On Mon, May 09, 2011 at 06:57:48PM -0500, Javier D?az Reinoso wrote:
> I known the etoys is almost d...

Cool!

And of course Etoys is not dead at all, but it could use a little love.
I think that many people on this list are looking for ways to contribute
to Squeak, and working on updating Squeak for better Etoys support would
certainly be one of them. Remember, for every developer working with
Squeak or Pharo there might be another million kids using Etoys who would
appreciate your help.

If we can make progress getting Etoys to work without problems on Squeak
trunk, and of course to make it a fully unloadable/reloadable package,
then millions of kids (and quite a few big kids too) can take advantage
of the latest improvements in Squeak as well as the speed improvements
of the high-performance Cog VM. That should make Etoys much faster and
better for everyone.

Dave




Reply | Threaded
Open this post in threaded view
|

Re: [OT] Two hacks with EToys

Edgar J. De Cleene-3
In reply to this post by David T. Lewis



On 5/9/11 11:13 PM, "David T. Lewis" <[hidden email]> wrote:

> On Mon, May 09, 2011 at 06:57:48PM -0500, Javier D?az Reinoso wrote:
>> I known the etoys is almost dead in squeak (and really dead in pharo), but
>> sometimes I need some quick tools like this:
>
> Cool!
>
> And of course Etoys is not dead at all, but it could use a little love.
> I think that many people on this list are looking for ways to contribute
> to Squeak, and working on updating Squeak for better Etoys support would
> certainly be one of them. Remember, for every developer working with
> Squeak or Pharo there might be another million kids using Etoys who would
> appreciate your help.
>
> If we can make progress getting Etoys to work without problems on Squeak
> trunk, and of course to make it a fully unloadable/reloadable package,
> then millions of kids (and quite a few big kids too) can take advantage
> of the latest improvements in Squeak as well as the speed improvements
> of the high-performance Cog VM. That should make Etoys much faster and
> better for everyone.
>
> Dave


We could unload Etoys from Trunk and replace with last version Etoys of
http://www.squeakland.org/

Edgar



Reply | Threaded
Open this post in threaded view
|

Re: [OT] Two hacks with EToys

Karl Ramberg
+ 1
Karl

On Tue, May 10, 2011 at 12:35 PM, Edgar J. De Cleene <[hidden email]> wrote:



On 5/9/11 11:13 PM, "David T. Lewis" <[hidden email]> wrote:

> On Mon, May 09, 2011 at 06:57:48PM -0500, Javier D?az Reinoso wrote:
>> I known the etoys is almost dead in squeak (and really dead in pharo), but
>> sometimes I need some quick tools like this:
>
> Cool!
>
> And of course Etoys is not dead at all, but it could use a little love.
> I think that many people on this list are looking for ways to contribute
> to Squeak, and working on updating Squeak for better Etoys support would
> certainly be one of them. Remember, for every developer working with
> Squeak or Pharo there might be another million kids using Etoys who would
> appreciate your help.
>
> If we can make progress getting Etoys to work without problems on Squeak
> trunk, and of course to make it a fully unloadable/reloadable package,
> then millions of kids (and quite a few big kids too) can take advantage
> of the latest improvements in Squeak as well as the speed improvements
> of the high-performance Cog VM. That should make Etoys much faster and
> better for everyone.
>
> Dave


We could unload Etoys from Trunk and replace with last version Etoys of
http://www.squeakland.org/

Edgar