Eduardo-
Glad to hear In App purchasing is now available on your device. Example scripts are in development and will be made available, but here are a few tips to help get you started.
Asynchronous callbacks are quite simple to implement. Simply:
- Create the UI object, a button in this example, and add it to a view (background or your own custom view).
- Set the event field on the UI object to the name of the function.
When the control event fires, the function set in the control event field is executed asynchronously. The event types are documented for each control type and the included example script, 'guidemo.lua' should help in getting started.
Here is a quick example where a push button is added to iLuaBox's background view, and when pressed, executes the 'testButtonPressed' function.
function testButtonPressed ()
gui.alertView("User Action",
"Test button was pressed.",
nil,
{"OK"})
button:destroy()
end
dofile("gui.lua")
button = gui.newButton {title = "Test", frame = {origin = {x = 30, y = 30}, size = {width = 80, height = 30}}, buttonType = gui.buttonTypeRoundedRect}
button.controlEventTouchUpInside = testButtonPressed
gui._BACKGROUND:add(button)
Tom Skwara
MobileApp Systems