User Interaction - Fill in Object data?

Aaron J Reichow reic0024 at d.umn.edu
Tue May 27 23:21:22 UTC 2003


On Tue, 27 May 2003, Avi Bryant wrote:

> > ^ #( (#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.
>
> Of course, do you really want to be able to put *any* number in the age?
> More likely you want this to be between 0 and, oh, 120 or so. Similary,
> what do you do with (#zipCode #SmallInteger)?  What about collections?
> Would you just do (#children #Set), or (#children #Set #Person), or what?

I've thought of the same things, and they're important considerations.
There are a couple ways I've considered implementing it, but for now, I've
skipped past it.  However, its set up such that adding it will not break
anything down the line.

The kind of thing I was thinking about eventually is:

{  {#name . #String} . "name is a string"
   {#birthday . #Date} . "give us a date picker"
   {#age . #SmallInteger . [:a | a between: 0 and: 120] } .
	"a number between 0 and 120.
	(line at: 3 ifAbsent: [nil]) isKindOf: BlockContext ..."
   {#sex . #String . {'female' . 'male' . 'n/a'}} .
	"presents us with a drop down box"
   {#children . #OrderedCollection . #PDAChild} }

Collections aren't something I've thought about too much outside of this.
The format above could be used, an #EvalString, or something totally
different.  In the above example, the system sees that #children stores a
collection of PDAChild objects.  It presents the user with a drop down box
showing the printString'd PDAChild objects currently entered, and buttons
to add, edit, and remove entries.  When one adds or edits, it drops into
the PDAChild object, bringing upthe Object Editor on the specific
PDAChild, new or already containing data.

Regards,
Aaron

  Aaron Reichow  ::  UMD ACM Pres  ::  http://www.d.umn.edu/~reic0024/
"Like the creators of sitcoms or junk food or package tours, Java's designers were
consciously designing a product for people not as smart as them."  ::  paul graham



More information about the Squeak-dev mailing list