On Saturday, July 1, 2017 at 11:06:58 PM UTC+1, Christopher Roe wrote:
>
> Just in case this conversation is still active .. and following on from 
> OverMind's suggestion that the Dialog interface be redrawn to match the 
> current need for user input via a dialog ... If I have 2 buttons visible on 
> the screen at the same time, how can I tell which button was pressed when 
> rendering the dialog?  There does not seem to be any opportunity to update 
> the model... or is there?  It feels like I should open the dialog via 
> something like  a command on the back of handling a message in update.  
>

Buttons are distinguished by passing different values for the Index 
parameter to Button.render:

http://package.elm-lang.org/packages/debois/elm-mdl/8.1.0/Material-Button#render

Then to create a Cmd that is triggered when the button is clicked, use 
Button.onClick, with some Msg type that you have created to receive these 
events.

For multiple dialogs, you'd use different Index parameters and .onClick 
events. Hope that makes sense?

-- 
You received this message because you are subscribed to the Google Groups "Elm 
Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to