With that question about better to delete widgets or keep them in memory.

I just came across a good example. So I have a page that goes that shows
quite a long list of information and it has to go out and collect that from
DBs and stuff.

As my app only has a few pages .. I'm leaving that in RAM as the user is
likely to flick back to it a few times.

Another site I'm working on is a product catalog (shopping cart) sort of
thing. At the moment I create the page and widgets for each product on the
fly, and for product lists too. Otherwise I'd have hundreds of customized
table lists and pages lying around being useless. I might look at caching
some widgets and/or results later, but so far seems to be reasonably fast as
is.

Kind Regards,
Matthew Sherborne




On Thu, May 26, 2011 at 8:38 AM, Matthew Sherborne <[email protected]>wrote:

> 1) if another user (or me) to insert a new 'Album', what I gotta do to
>
> get my album page refresh itself? (c++ events?)
>
>
> What's triggering the event ? if it's in the same thread use signals and
> slots<http://www.webtoolkit.eu/wt/doc/reference/html/overview.html#signal_slot>.
> If it's in a different thread, take a look at the chat 
> example<http://www.webtoolkit.eu/wt/examples/chat>
> .
>
> 2) if I have several cpp pages, I have to enter all in the
>
> WStackedWidget? But I do not want all in the WMenu, only the most
>
> important links.
>
>
> Either use the witty home 
> page<http://www.webtoolkit.eu/wt/examples/#/src/wt-homepage>example with the 
> defercreate thing. Or just WAnchor and an 'on url change'
> event:
> http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WAnchor.html
>
> 3) if a user clicks on several links, all pages will stay in memory?!
> Would not it be better to show the page and release it from memory?
>
> I guess that depends on the app. I find my apps even with 100s of sessions
> open still use tonnes less RAM than non c++ apps.
>
> I guess you could use the URL change event to clear out widgets that aren't
> visible, then create new widgets as needed.
>
>
>  WApplication::instance 
> <http://www.webtoolkit.eu/wt/doc/reference/html/classWt_1_1WApplication.html#a38d922da0a0d83395519f3eaab85d0f6>()->internalPathChanged().connect(this,
>  &MyWidgetOrClass::createAndDestroyWidgetsBasedOnURL);
>
>
> I hope that helps. Just my 2c.
>
> Kind Regards,
> Matthew Sherborne
>
>
>
------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
witty-interest mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to