Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
iOS Only - Using the Wax Framework from Andy Bower — Gideros Forum

iOS Only - Using the Wax Framework from Andy Bower

OZAppsOZApps Guru
edited September 2012 in Code snippets
waxClass{"UIAlertViewDelegate",protocols = {"UIAlertViewDelegate"}}
 
alertViewDelegate = UIAlertViewDelegate:init()
function alertViewDelegate:alertView_clickedButtonAtIndex (a, b) 
  print(">> Tapped on button ", b) 
  -- This is generally 0 based, so the OK Button will be 0 and then One =1, Two=2, Three=3 and so on.
end 
 
alert = UIAlertView:initWithTitle_message_delegate_cancelButtonTitle_otherButtonTitles("title", "message",alertViewDelegate,"OK",nil)
 
alert:addButtonWithTitle("One")
alert:addButtonWithTitle("Two")
alert:addButtonWithTitle("Three")
 
alert:show()
You can also use this on the iOS to allow the user to select from a list of options.
Note: Earlier it would turn into a scrollable list, now it just stacks up and looks ugly :( So have a maximum of about 4 buttons apart from the OK

Dislikes: Ghando

twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
Cool Vizify Profile at https://www.vizify.com/oz-apps
+1 -1 (+0 / -1 )Share on Facebook

Comments

Sign In or Register to comment.