How to call Popup Dialog Device's Responses in Verse


I want to use this method inside the popup dialog device but not sure how to setup the handle function since it involves a tuple.

My goal is to have a Pop Up Dialog Device show up after I click Response 1 of another Pop Up Dialog Device.

I tried this below but it doesn’t work. Anyone have tips on this? Thanks!

OnResponse1Click(tuple[Agent : agent, ResponseButton]) : void =
if (set ResponseButton := 1):
SecondUI.Show(Agent)

1 Like

It’s been long time since you asked but I ran into this issue. Here is the working code.

Makes this Popup appear in the in the Hello World Device (Make sure you link it)

@editable MyPopup : popup_dialog_device = popup_dialog_device{}

Listener for someone pressing any of the popup buttons

MyPopup.RespondingButtonEvent.Subscribe(PopUpPress)

Function called when popup is pressed, This is the turple(agent, int)

PopUpPress(Agent : agent, Number : int) : void =
Print(“Popup button triggered {Number}”)

if a turple is required you just define the parameters in function header do not need to define it as a turple.

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.