User Interaction - Fill in Object data?

Aaron J Reichow reic0024 at d.umn.edu
Tue May 27 20:54:26 UTC 2003


On Tue, 27 May 2003, Ingo Hohmann wrote:

> what is the best way to get user input to fill in data for an object?
> (The same what Morphic-PDA does by just letting users to fill in the
> text, which is later scanned and an object build from this, but with a
> more advanced UI.)
>
> Do I have to build a morph with textsubmorphs by hand? Is it possible to
> 'attach' the object data fields to the UI, so that changes in the data /
> in the UI get propagated to the respective other automatically?

To my knowledge, there's no easy way to do that now in stock Squeak.  The
PDAMorph handles the data entry itself.

However, I've been working on something like this for Dynapad.  The only
support an object has to have to use this well is a method which returns
an array of symbol for the names of the variables which are to be
modified, along with the type.  That is, for a simple addressbook:

^ #( (#name #String) (#age #SmalInteger) (#birthday #Date))

meaning, you can enter any string in the name box, any number in the age,
and you get a date picker for birthday.  When you click "OK" the changes
are made to the object and because different people would use it
differently, the object is returned.  If you click "Cancel" it doesn't
make any changes and returns the un-tained object.

It would be pretty easy to expose everything in the object if the editable
method is missing.

With this morph of mine, things aren't evaluated like there are in
PDAMorph- meaning you don't type out dates as a literal date, and don't
need 's for a string. There is a type (#EvalString instead of #String)
that does eval what was entered, assigning that to the variable, however.

This code is unreleased as of now, but if you have a pressing need for it,
I can see about cleaning and packaging it up within a week or so.
Otherwise, it'll be available with the rest of the next Dynapad release
Real Soon Now.

You could also just embed an inspector. Not quite the same, but closish.

Regards,
Aaron

  Aaron Reichow  ::  UMD ACM Pres  ::  http://www.d.umn.edu/~reic0024/
  "corporation, n: an ingenious device for obtaining individual profit
          without individual responsibility."        :: ambrose bierce



More information about the Squeak-dev mailing list