any update on Widget support within Storyboard coronalabs?

Hi Coronalabs,

Any update on Widget support within Storyboard coronalabs?

Is the status still as per the below-mentioned FAQ? Or has there been improvements/updates in the daily builds? Any heads up re when the below-mentioned constraints will be addressed? thanks
http://www.coronalabs.com/blog/2011/11/16/common-storyboard-api-questions/#does-storyboard-work-with-widgets
[text]
Does Storyboard work with widgets?

You should be fine using widgets with Storyboard, however, there are some known issues. When it comes to using the tableView, scrollView, pickerWheel, and possibly the slider widget in conjunction with storyboard, it is recommended you treat these widgets as you would native widgets, in that you cannot insert them into a group.

If some of your scenes have problems with any widgets (the tableView seems to be the most problematic), I recommend creating them on every “enterScene” event, and removing them on every “exitScene” event (so you don’t have to insert them into the “view” property of the scene). It is also recommended that you do not use effects when transitioning to and from scenes that use problematic widgets.

When using the tableView, scrollView, pickerWheel, and possibly the slider, you should avoid inserting them into the scene’s “view” group (which is why they should be created/removed during “enterScene” and “exitScene”. Buttons and tabBars should work fine.

Also, this applies to buttons and tabBars as well, you must manually remove widgets (because they are not removed automatically when their parent group is removed), so be sure you are manually removing the widgets at some point (either in your “exitScene” or “destroyScene” event listeners).

NOTE: We are working on fixing the issues with the problematic widgets.
[/text] [import]uid: 140210 topic_id: 29279 reply_id: 329279[/import]

That was a fairly old blog post. Is there still issues with this ? [import]uid: 84637 topic_id: 29279 reply_id: 117721[/import]

Hi Danny,

I guess I’m trying to read “reference” documentation on how to use Storyboard with Widgets. Perhaps I am getting mixed up between hits from the WebSite as opposed to Reference API doco?

Any advice re how I would use the Corona website to confirm/deny if there are still issues or not? For example:

a) what is best practice now re which call back methods in Storyboard to create widgets
b) does Storyboard auto cleanup widgets afterwards now?
c) do you add widgets to the storyboard “scene.view”
d) when you create an object with a widget you give it the listener, however in Storyboard the idea is you create the object in createScene, and then add the listener in enterScene etc, so is there an issue here?

thanks [import]uid: 140210 topic_id: 29279 reply_id: 117722[/import]

I would use the reference api docs, really. There are a lot of old blog/forum posts with information that has changed. The API docs have a ‘gotcha’ section that is pretty good about letting you know of any caveats.

I have had no issues with widgets/storyboard. I do add them to the scene,view. It does clean them up. for you.
[import]uid: 147305 topic_id: 29279 reply_id: 117723[/import]

I would concur with budershank. I haven’t seen any bug reports related to the issues outlined in the blog post in over 4 months.

If you do find an issue however, feel free to report it via our bug tracker. [import]uid: 84637 topic_id: 29279 reply_id: 117724[/import]

ok thanks guys - how about then just my last question - that is:

Noting:
* When you create an object with a widget you give it the listener there and then (i.e. in one hit)
* However in Storyboard the idea is you create the object in createScene, and then add the listener in enterScene (and remove in exitScene)

Question
* Which method should you create your “create widget”
* If “createScene” - then I assume as you jump to another storyboard and back, the widget listener remains in place (i.e. you don’t remove it?)
* If “enterScene” - then I guess you recrease the whole widget ever time you jump to another storyboard and back, effectively having no “caching”

Just trying to understand the theory here…

[import]uid: 140210 topic_id: 29279 reply_id: 117779[/import]

Well just so you aren’t waiting on my response I’m not sure what to tell you. I just dispose of my scenes and remake them as needed. Since aside from loading level data I’m not really doing anything intensive it is all seemingly instant anyway. [import]uid: 147305 topic_id: 29279 reply_id: 117780[/import]

Storyboard and widgets work together perfectly fine for me. It was really rough and broken last summer but now is sparkling.

  1. You can create the widget whenever you like, really. They are just display objects like everything else. It just depends how you intend to use it. There is a short delay between createScene and enterScene, of course, but you can and probably should mask that with a fade or screen or something.

  2. Yes, when you jump and come back, unless memory usage was really high your scene will be exactly as you left it. You want to unplug listeners whenever possible during exitScene and plug them back in during enterScene, but that’s mainly for Runtime: types. I can see disabling touch listeners being some advantage at scale, of course, but not required in all situations. Depends what you mean by “widget listener” though…

  3. Recreating a widget is not really as performance intensive as it sounds, unless you have a ton of image content or 300+ rows or something. Again, really dependent on usage.

As an example, I have an app in development which basically has a long list (200 entries) and a segmented control at the top of the screen that allows me to sort the list by different criteria. There’s no easy/useful way to sort newTableView(), so I literally just, on button press, kill the entire table view, generate the new table, and then recreate the newTableView(). The process is instant. [import]uid: 41884 topic_id: 29279 reply_id: 117810[/import]

thanks Richard

re “unplug listeners whenever possible during exitScene and plug them back in during enterScene, but that’s mainly for Runtime: types”

ok, this helps me understand Storyboard a bit better - so the Corona guys perhaps give us the concept of removing listeners in exitScreen but like on the basis (a) for Runtime listeners this is must to get them out of the way, but still have caching on the display objects, but (b) for display objects it would still be possible and recommended but more just a nice-to-do [assuming you don’t have scaling issues] - I think I have this right?

[import]uid: 140210 topic_id: 29279 reply_id: 117812[/import]

Runtime is a must because they are connected to the .app, not to any particular display object, hence why Corona Labs says you have to remove them manually.

touch and tap listeners are much safer to deal with. While technically they might be active if you switch scenes, each scene is in a different location so you wouldn’t be able to touch it.

(The only reason I can really think of to kill such listeners would be if you have so many of them that performance is noticeably impacted.)

On my current app I have multiple different lists, each on their own button (accessed via widget.newTabBar() ) - and I just leave them as is unless I need to do something destructive, like sorting. 90% of the time I just use gotoScene and everything is fine. In fact for all of my storyboard projects its pretty rare for me to put something in exitScene at all, beyond Runtime removers.

So yeah, I think you have it right. [import]uid: 41884 topic_id: 29279 reply_id: 117825[/import]