very basic listbox code request for comments

Timmy Douglas timmy+slate at cc.gatech.edu
Sun May 14 12:46:00 PDT 2006


Brian Rice <water at tunes.org> writes:

> That's the reason for "cascade" in the CSS acronym: so that separate  
> stages of styling can be grouped and updated separately.
>
> How this is worked out on a technical level with a live-object
> environment is up to your imagination, and implies some overhead to
> track the styles and recompose, but this doesn't seem like a heavy
> price.

it seems like #addDynamicSlot: could take care of this, except I'm not
sure if there is a way to "re-point" things back to the original
object after you call #addSlot: on one of the children (would just
removing it work?). I don't want to go ahead and write code when there
might already be a language feature to do it.


But this part of it doesn't make sense root.slate (L525):

x@(Root traits) addDynamicSlot: slotName valued: val
"This creates a `dynamic slot', which means an immutable delegated slot
that can be overridden from its default per object, making an effective
customization policy.
It works by ensuring that the object has a slot of that name with that value,
and finally defining a mutator method on it to define a new slot on the
*receiver* when mutations are attempted."
[
  x addImmutableSlot: slotName valued: val.


" why not addImmutableDelegate? "



  [| :obj :val | obj addSlot: slotName valued: val]
    asMethod: (x mutatorNameFor: slotName)
    on: {x. NoRole}.
  x
].




When I tried copying and pasting that code and making the change in
theme.slate, then loading it, but I got weird errors later in ui.slate
where:


Debug [0..1]: lobby mainWindow.
-2.000009


etc. it seemed like the constructor functions returned the correct
objects but somewhere along the line things got corrupted?


I'll use darcs to send the patch later when I have something useful
working.



More information about the Slate mailing list