CRESS-Surrey / eXtraWidgets

An extension for creating additional interface tabs in the NetLogo GUI and putting custom widgets on them.
MIT License
13 stars 4 forks source link

syntax errors in the context demo section #168

Open brandesNW opened 7 months ago

brandesNW commented 7 months ago

I also found a few things confusing, and made changes in my version below

These could be seen as user errors, but I spent some time figuring things out. This was partly because at one time I got a runtime error which I was not able to reproduce.

This is the version I wound up using:

extensions [xw]

to setup
  xw:clear-all
   xw:create-tab "t1" [
    xw:set-title "Three Sliders"
  ]
  foreach ["alpha" "beta" "gamma"]
  [ x -> xw:create-slider x [
      xw:set-color one-of base-colors
      xw:set-label xw:key
    ]
  ]
  (foreach (but-last xw:sliders) (but-first xw:sliders) [
    [ sl1 sl2 ]-> xw:ask sl2 [ xw:set-y [ xw:y + xw:height + 10 ] xw:of sl1 ]
])
end