π
Mmarimo
β’Created by π on 11/15/2023 in #archived-help-and-support
Creating a list of buttons
(I didn't get a notification so didn't see the response till now!!)
15 replies
Mmarimo
β’Created by π on 11/15/2023 in #archived-help-and-support
Creating a list of buttons
Thank you!!
15 replies
Mmarimo
β’Created by π on 11/15/2023 in #archived-help-and-support
Creating a list of buttons
It worked! Hallelujah thank you so much! I donβt fully understand the code thoughβ¦ is this making the dictionary of buttons twice?
15 replies
Mmarimo
β’Created by π on 11/15/2023 in #archived-help-and-support
Creating a list of buttons
Thanks! @Akshay . Out now and will take a look soon. Thank you for looking into this so promptly!
15 replies
Mmarimo
β’Created by π on 11/15/2023 in #archived-help-and-support
Creating a list of buttons
Hi @Akshay and @Myles Scolnick , thanks a lot for the followups; I haven't been able to fully dedicate time to this button issue. It turns out I had a hack it seems... and it's still not ideal.
I am wondering if for the following use case, what I have is the only way.
Use case: I want to create a vertical stack of N buttons, where N can vary. Each button is supposed to initiate an action according to the index of the button in the N-array. In addition, I prefer not to see "dictionary" or "array".
What I have right now:
The look I'd like is in
# cell 4
and not # cell 5
but unfortunately the reactivity in get_x()
does not work if I only have # cell 4
without cell 5
...
I have tried `mo.ui.batch
suggested but I could not get the dynamic change of the number of buttons according to N work. Is there something else I can try, or modify? Thank you!15 replies
Mmarimo
β’Created by π on 11/15/2023 in #archived-help-and-support
Creating a list of buttons
Oh odd⦠it works now
15 replies
Mmarimo
β’Created by π on 11/15/2023 in #archived-help-and-support
Creating a list of buttons
Hi! I have a follow up question - I want to display my_dict without showing the key and dictionary view. What I can manage is mo.vstack([my_dict.elements[k] for k in my_dict.value.keys()]). But that seems to have disabled the button on_click functionality. Is there a way to do that? I wonder if itβs scope issue again. Sorry typing on the phone so not writing the code view properly.
15 replies
Mmarimo
β’Created by π on 11/15/2023 in #archived-help-and-support
Creating a list of buttons
Thanks, Myles! Dictionary worked. Thanks so much life is beautiful again π€©π€© definitely missed that in the documentation and should have thought of global scope.
15 replies