> If I use button1:action, it was necessary to place it inside main whereas I
> want
> to place it outside.
> How to link button1 to the button1_action(?
You can retrieve the button1 handle after calling "main". For instance:
local button1 = dlg[1][1]
Or you can save the button as a custom dialog attribute inside "main" then
retrieve it outside. For instance:
return iup.dialog{vbox; title = title, button1 = button1}
Then
local button1 = dlg.button1
> button1 = iup.button{title = 'Botão 1'}
> iup.SetAttribute(button1, 'ACTION', 'button1_action') vbox = iup.vbox{button1}
> return iup.dialog{vbox; title = title} end Actually, I want to use
> iup.SetAttribute
> to link events. I could place my callback without closures and without action
> =
> function()..
> Why didn't iup.SetAttribute work?
Because it will assume that your callback is implemented in C and associated
with IupSetFunction. In Lua you must use a Lua function to directly associate
the callback.
Best,
Scuri
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users