Newbie: help on Form

Dan Ingalls Dan at SqueakLand.org
Tue Nov 20 19:55:56 UTC 2001


Hello, Hsin-Hao -

If you want to use Forms, then go ahead, but you might find the simplest way to do this is to make a morphic structure, and let the system take care of displaying it.

This plan would look more like:
1.  Define a StimulatorMorph subclass of Morph
2.  write a 'step' method that makes the morph look one way or another depending on the time.
3.  For instance, you would get one appearance by doing
	self removeAllMorphs.
	self addMorph: EllipseMorph new.
    and a different appearance by doing
	self removeAllMorphs.
	self addMorph: StarMorph new.

>From there on, you will want to investigate changes to the step time, positioning your morphs properly, how to sequence through some set of morphs, etc.  Note that you can also use ImageMorphs or SketchMorphs which can be created from GIF or JPEG files.

Hope this helps.  Let us know if you can't even get started.  Many people on this list could write you a 10- or 20-line example that would at least work.  There may even be something like this in one of the tutorials.

	- Dan
-------------------------
>Hello! This is an extremely newbie question. I just started to use
>Squeak to construct visual stimuli for some brain imaging experiments,
>but I am quite intimidated by Squeak's drawing primitives, and the lack
>of documentation.
>
>The problem is simple: I want to draw a bunch of polygons filled
>with colors, but it has to be drawn as fast as possible, since
>timing is critical. What is the best way to do this in Squeak?
>
>My plan is:
>1. create a Form
>2. use the drawLine:from:to:clippingBox:rule:fillColor method
>   to draw the edges of the polgons.
>3. use of of the methods in the "filling" category of the Form class
>   to paint color to the polygon
>
>I am stucked by two problems:
>1. I have no idea what the arguments to "drawLine:from:to:clippingBox:
>   rule:fillColor" should be. What is a "source"? what rule?
>2. I want to choose a filling algorithm that is as efficient as possible
>   for simply polygons.
>
>Would someone be so kind of help a beginner? In return to the community
>I would share the result when it is finished, as an example of using the
>Form class. Thanx a lot.





More information about the Squeak-dev mailing list