Hi Scott,

  In the callbacks of the two buttons I would store a value, for instance
"status", on the dialog.

function ok_but:action()
  local dlg = iup.GetDialog(self)
  dlg.status = true
end
function cancel_but:action()
  local dlg = iup.GetDialog(self)
  dlg.status = false
end

  So after popup returns you can check

  if (dlg.status) then
     ....
  end

  A very simple form. (Didn't check for errors)

Best,
Scuri


Em sex., 8 de jan. de 2021 às 08:51, Scott Morgan via Iup-users <
iup-users@lists.sourceforge.net> escreveu:

> Assume you have some iup.dialog with Cancel and OK buttons, where their
> action events return iup.CLOSE.
>
> What's the best way to find which button the user closed the dialog with
> from an dlg:popup call?
>
> I can think of a few methods, but they all seem clunky (i.e. setting a
> global)
>
> Scott
>
>
> _______________________________________________
> Iup-users mailing list
> Iup-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/iup-users
>
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to