How to draw a Morph with Athens?

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

How to draw a Morph with Athens?

MartinW
At the moment i draw Morphs with Athens by copying how it is done in AthensDemoMorph:

- adding a surface variable,
- initializing an AthensCairoSurface,
- getting an athens canvas by calling: surface drawDuring: [:canvas | ]
- …

Is there already a more straightforward possibility in the meantime?
Also the way it is done in the AthensDemoMorph, when i save and quit an image with such a Morph open, there is a drawing error (red rectangle with yellow cross), once i restart the image.

BTW, i really like drawing with Athens!
M.
Reply | Threaded
Open this post in threaded view
|

Re: How to draw a Morph with Athens?

Igor Stasenko
u you u no draw morphs by athens :)

- use AthensWrapMorph.
put as many submorphs into it, and they all will be drawn via Athens.
eventually, the need in wrap morph will disappear once WorldMorph (the root of all morphs) start using Athens directly.



On 28 March 2014 18:53, MartinW <[hidden email]> wrote:
At the moment i draw Morphs with Athens by copying how it is done in
AthensDemoMorph:

- adding a surface variable,
- initializing an AthensCairoSurface,
- getting an athens canvas by calling: surface drawDuring: [:canvas | ]
- …

Is there already a more straightforward possibility in the meantime?
Also the way it is done in the AthensDemoMorph, when i save and quit an
image with such a Morph open, there is a drawing error (red rectangle with
yellow cross), once i restart the image.

BTW, i really like drawing with Athens!
M.



--
View this message in context: http://forum.world.st/How-to-draw-a-Morph-with-Athens-tp4751463.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.




--
Best regards,
Igor Stasenko.
Reply | Threaded
Open this post in threaded view
|

Re: How to draw a Morph with Athens?

MartinW
Igor Stasenko wrote
u you u no draw morphs by athens :)

- use AthensWrapMorph.
put as many submorphs into it, and they all will be drawn via Athens.
eventually, the need in wrap morph will disappear once WorldMorph (the root
of all morphs) start using Athens directly.
Ok, thank you, that's nice.
What is the intended use - subclass AthensWrapMorph instead of Morph for my own Morphs, or make my Morphs subclasses of Morph as usual and always create a AthensWrapMorph and then add them as submorphs?

M.
Reply | Threaded
Open this post in threaded view
|

Re: How to draw a Morph with Athens?

pharo4Stef@free.fr

On 30 Mar 2014, at 17:34, MartinW <[hidden email]> wrote:

> Igor Stasenko wrote
>> u you u no draw morphs by athens :)
>>
>> - use AthensWrapMorph.
>> put as many submorphs into it, and they all will be drawn via Athens.
>> eventually, the need in wrap morph will disappear once WorldMorph (the
>> root
>> of all morphs) start using Athens directly.
>
> Ok, thank you, that's nice.
> What is the intended use - subclass AthensWrapMorph instead of Morph for my
> own Morphs,



the second choice.
This way when we swicth to athens you will have nothing to do.

> or make my Morphs subclasses of Morph as usual and always create
> a AthensWrapMorph and then add them as submorphs?
>
> M.
>
>
>
>
> --
> View this message in context: http://forum.world.st/How-to-draw-a-Morph-with-Athens-tp4751463p4751715.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>