elkowar / eww

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

[BUG] Can't control selected Stack Child using `:selected` #1116

Open Faervan opened 3 weeks ago

Faervan commented 3 weeks ago

Checklist before submitting an issue

Description of the bug

I can't get the stack widget to work. It always only shows the first defined child, instead of using the index provided by selected. eww logs gives a GtkError:

(eww:869899): Gtk-WARNING **: 21:36:31.593: Child name 5 not found in GtkStack

Reproducing the issue

; Shows a instead of f
(stack :selected 5 :transition "none" :same-size false
          (label :class "icon" :text "a")
          (label :class "icon" :text "b")
          (label :class "icon" :text "c")
          (label :class "icon" :text "d")
          (label :class "icon" :text "e")
          (label :class "icon" :text "f")
          (label :class "icon" :text "g")
          (label :class "icon" :text "h"))

Expected behaviour

A widget that displays one of its children at a time
selected: int index of child which should be shown

Should show one child element, depending on the int given to :selected

Additional context

No response