Re: [macroid] How to show/hide a list of generated buttons

6 views
Skip to first unread message

Nick Stanchenko

unread,
Jun 22, 2017, 8:56:37 AM6/22/17
to mac...@googlegroups.com
Hi,

My guess is that “buttonSlots.toList <~ hide” already returns a UI action, which you then wrap into another Ui. Removing the outer Ui should do the trick.

Nick

On 22.06.2017 05:49, Jeff Mather wrote:
Hello,

I am generating a series of buttons using a function like this:

val buttonSlots = ListBuffer[Option[ImageButton]]()

def createButton() = {
   
var buttonSlot = slot[ImageButton]
    val button
= w[ImageButton] <~ wire(buttonSlot) <~  res(R.drawable.crosshair) <~ On.click {Ui { buttonSlots.toList <~ hide } }
    buttonSlots += buttonSlot
   
button
}

Hiding the buttons as a list, as is done in the click handler, does not work.  Would you know why?  There is no exception; just nothing happens.  I have tried many variations, to no avail.  Thanks!




--
You received this message because you are subscribed to the Google Groups "macroid" group.
To unsubscribe from this group and stop receiving emails from it, send an email to macroid+u...@googlegroups.com.
To post to this group, send email to mac...@googlegroups.com.
Visit this group at https://groups.google.com/group/macroid.
To view this discussion on the web visit https://groups.google.com/d/msgid/macroid/2e87f4ed-325c-41d1-a648-bd5757e9e7dc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages