[Squeakland] Squeak first impressions and a couple questions
Scott Wallace
scott.wallace at squeakland.org
Wed Nov 8 02:51:43 PST 2006
Hi, Jeff/Julio,
As others have mentioned, many of your queries are probably best
directed at the squeak-dev or seaside mailing list. However, I'll
try to answer some of them here anyway:
> 1. When creating a new morph, how do you get it to appear in the
> flaps registry?, ( I managed to successfully create a read only
> text morph by copying the textmorph class and removing the
> HandlesKeystroke method, but I don't know how to get it into the
> supplies flap. )
>
(a) Just pick up an instance of your morph with the mouse (use the
black halo handle if necessary,) drag it over the Supplies flap, then
"drop" it into the flap. From then on, you can pull new instances of
your kind of morph out of the Supplies flap at will.
(b) Rather than copying the entire TextMorph class to bring about
one change, it would be more conventional to *subclass* TextMorph,
and in your custom subclass supply only an override for that one
message.
(c) You can make any vanilla text morph "read-only" by simply
turning on the "be locked" option in its halo menu, so perhaps you
don't really require any code change at all.
(d) If none of the above three suggestions suits your needs, and you
really want to get involved with the "Flaps registry", you'll
probably want to be modifying method Flaps class
defaultsQuadsDefiningPlugInSuppliesFlap and
defaultsQuadsDefiningSuppliesFlap.
> 2. I figured out how to get my race car to react to keystrokes, but
> I'd like to get it to react to keys that are still down. In other
> words, when I keep holding the up arrow after hitting the left
> arrow, I want it to continue accelerating without me needing to hit
> the up arrow again. Is there a way to script "KeyBeingHeldDown" or
> something like that?
>
No, unfortunately not. The closest thing I can recommend is to
script an acceleration *button* to fire on mouse-still-down.
> 3. While playing around with text entries, I managed to get scripts
> to fire based on the text's last character... unless that character
> is the enter key. I tried <cr> for carriage return, and other
> variations to represent that, to no avail. How can I start a script
> from a person hitting enter after typing a command in the text field?
>
Not easily. The "enter" key often serves as a signal that character-
entry in some context is done, and for this to work, it is not
treated as a normal text character; instead it is intercepted specially.
More tractable is to have your user submit by hitting a *carriage
return* rather than the enter key. Proper handling of this, assuming
that you want to trigger a script when the cr is hit, then not again
until cr is hit again, is still going to require a slight excursion
into textual scripting. You can check for the field's characters'
last character being equal to a cr, and if it is, you both: (a)
remove that last character, so you won't encounter it again on the
next tick and (b) trigger your desired script.
I'm attaching here a little project that illustrates how to do this.
Not beautiful, but possible.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: crExample-sw.001.pr
Type: application/octet-stream
Size: 25711 bytes
Desc: not available
Url : http://squeakland.org/pipermail/squeakland/attachments/20061108/4f0dfadf/crExample-sw.001-0001.obj
-------------- next part --------------
> 4. I did see an older version of squeak that used a buttonbar in
> which morphs could be placed on little squeak logos which would
> then act as creators of those morphs. Was that removed, and if so why?
>
Not sure what it was or is that you're referring to. Perhaps the
SmallLand image used in Spain? The behavior you describe is very
similar to the way that flaps such as the Supplies Flap can be used,
as described in 1(a) above, but given the mention of "little squeak
logos" that's obviously not what you saw.
These last three are all well outside the scope of the Squeakland
mailing list, so all I can offer for these is suggestions about where
to search for more info:
> 5. Are there any plans to make some standard morphs for widgets
> such as those which come with Glade or WXWidgets? I know about
> WXSqueak, but I'm wondering if there are plans to make those kinds
> of windows, listboxes, etc. as morphs, so that I can create and
> manipulate them in the same way I do with all the other morphs. I
> understand that it's unlikely that such morphs would look "native",
> but I believe that is an overrated concern. Whether the aesthetics
> match my windows theme, Mac, Unix, etc. defaults is not concerning
> to me. I just want them to function in the same way.
>
Search the squeak-dev archives for "standard widgets" or some such
and you'll come up with plenty of discussion about this. There is
such a thing as "BobsUI", created years ago by Bob Arning, which
addresses much of what you mention. It's on SqueakMap.
> 6. On that same note, any good tutorials for WXSqueak that work
> with Squeak 3.8? (I did manage to get it installed through
> squeakmap, and the system browser shows a lot of WXwidgets
> packages, classes, etc. so I believe I did it right, but I have no
> idea how to use it.)
>
I suggest that you search squeak-dev archives for WXSqueak...
> 7. Also, is there a tutorial for Seaside that works with Squeak 3.8?
>
I suggest searching both the squeak-dev archives and the Seaside
archives, and/or subscribing to the Seaside mailing list and posing
the question there.
Cheers,
-- Scott
More information about the Squeakland
mailing list