Giving showWebPopup a dismiss or cancel button

9 replies [Last post]
William Bryant
User offline. Last seen 51 weeks 1 day ago. Offline
Joined: 24 Feb 2010

It would be nice if
native.showWebPopup( inUrl,webOptions )
could run inside a window or display that was slightly less than full screen size so there could also be a dismiss button.

At present there is no way (that I have found) for the user to dismiss the web popup when finished and return to the program.

the only alternative is to use native.showWebPopup( url ) to take you to safari
then when the user is done, return to the program which will hopefully be at the same screen

I would prefer screen shifting to dismiss the web popup.

But at present, there is not code way for a user action to trigger system.cancelWebPopup() is there?

William

Replies

jwwtaker
User offline. Last seen 17 hours 47 min ago. Offline
Joined: 28 Apr 2010

I am running into the same issue. If anyone has a work around for this at present it would be greatly appreciated, thanks!

d3mac123
User is online Online
Joined: 12 Feb 2010

Download the new beta 4 SDK. You can do it now.

jwwtaker
User offline. Last seen 17 hours 47 min ago. Offline
Joined: 28 Apr 2010

oh? is there an example of this functionality? changing the size of the popup window? i didnt see anywhere in the API how to do it

d3mac123
User is online Online
Joined: 12 Feb 2010

The new command is native.showWebPopup(x, y, x.size, y.size, "page.html", {baseUrl = system.ResourceDirectory, urlRequest = functionToBeCalled})

in order to cancel the popup, all you have to do is to create a button calling a function that run the native.cancelWebPopup command.

Alex

jwwtaker
User offline. Last seen 17 hours 47 min ago. Offline
Joined: 28 Apr 2010

oh great thanks, is there any way to rotate this window?

d3mac123
User is online Online
Joined: 12 Feb 2010

Never tried but you can try the following:

1
2
3
4
local window = display.newGroup()
local test = native.showWebPopup(x, y, x.size, y.size, "page.html", {baseUrl = system.ResourceDirectory, urlRequest = functionToBeCalled})
window:insert(test)
transition.to(window, {time=150, rotation=90})

let me know if it worked.
Alex

jwwtaker
User offline. Last seen 17 hours 47 min ago. Offline
Joined: 28 Apr 2010

didn't work. cant seem to find any way to rotate the webpopup window.

MikeHart
User offline. Last seen 2 hours 56 min ago. Offline
Joined: 22 Mar 2010

Are you using Beta4 and a build.settings file?

jwwtaker
User offline. Last seen 17 hours 47 min ago. Offline
Joined: 28 Apr 2010

yes

Viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.