elkowar / eww

ElKowars wacky widgets
https://elkowar.github.io/eww
MIT License
9.21k stars 380 forks source link

[BUG] Can't use `for` in a custom widget that delegates to `box` #934

Open Nemo157 opened 1 year ago

Nemo157 commented 1 year ago

Checklist before submitting an issue

Description of the bug

When defining a custom widget that delegates its children into a box, using that widget with a for as child fails:

error: This widget can only be used as a child of some container widget such as box
  ┌─ /nix/store/xi81k4i5a1pa8l6hqajg1088lf0bflz1-hm_eww/eww.yuck:5:10
  │
5 │   (v-box (for workspace in workspaces (label :text {workspace})))
  │          ───────────────────────────────────────────────────────
  │
  → Hint: try wrapping this in a `box`

Reproducing the issue

(defwidget v-box [] (box :orientation "v" (children)))

(defvar workspaces '["foo"]')
(defwindow taskbar
  (v-box (for workspace in workspaces (label :text {workspace})))
)

Expected behaviour

A widget wrapping a box should be allowed to accept for as children.

Additional context

No response

tokyob0t commented 10 months ago

Same