Solved: Widget Candy window won't close

I’m working on an app that needs to support orientation changes. My settings screen is created with Widget Candy. The setting screen closes when the user hits the “close” button and a new scene is loaded on storyboard.
This is how I defined the close function inside NewWindow:
 

onClose = function(EventData) storyboard.gotoScene( "MainScene" ) end  

Everything works fine until I try to change orientation.
However, after the orientation changes, the window will not dissapear when going to a new scene (i know that it does load the new scene, but the widget candy window stays on top and will not close)
 
Any ideas how to solve this?
I’m using Widget Candy 1.0.95 and Corona Daily build 1133

I think I was able to pinpoint the location where the problem starts, but not to fix it. If I comment-out line 164 in Widget Candy, specifically the command:

V.\_CheckProps(Widget)  

the problem dissapears. However, when I update the window properties with the “Set” function (I need to get the window to fit the new screen dimensions), the problem continues (can’t close the Widget Candy window again).

Just solved the problem. It was a stupid mistake by me.

I set the parent group of the window to “nil” instead of to a handle to self.view.

Try this:

onClose = function(EventData)

_G.GUI.GetHandle(“WIN_NAME”):destroy() 

–[[

Where G.GUI is the var you used in your requires"widget_candy" statement, and

WIN_NAME is the string you assigned to the windows name property in the NewWindow table

 This allows you to recreate the window if necessary (after an orientation change for example) from the same storyboard scene, like if you are calling it from a button tap function.

Using  _G.GUI.GetHandle(“WIN_NAME”):close() only hides the window.

I also use the destroy method for each widget inside the window, before I destroy the window itself.

]]–

storyboard.gotoScene( “MainScene” )

end

I think I was able to pinpoint the location where the problem starts, but not to fix it. If I comment-out line 164 in Widget Candy, specifically the command:

V.\_CheckProps(Widget)  

the problem dissapears. However, when I update the window properties with the “Set” function (I need to get the window to fit the new screen dimensions), the problem continues (can’t close the Widget Candy window again).

Just solved the problem. It was a stupid mistake by me.

I set the parent group of the window to “nil” instead of to a handle to self.view.

Try this:

onClose = function(EventData)

_G.GUI.GetHandle(“WIN_NAME”):destroy() 

–[[

Where G.GUI is the var you used in your requires"widget_candy" statement, and

WIN_NAME is the string you assigned to the windows name property in the NewWindow table

 This allows you to recreate the window if necessary (after an orientation change for example) from the same storyboard scene, like if you are calling it from a button tap function.

Using  _G.GUI.GetHandle(“WIN_NAME”):close() only hides the window.

I also use the destroy method for each widget inside the window, before I destroy the window itself.

]]–

storyboard.gotoScene( “MainScene” )

end