On Mon, Nov 12, 2012 at 5:08 PM, Koen Deforche <k...@emweb.be> wrote:

> Hey Rob,
>
> 2012/11/12 Rob Van Dyck <rob.van.d...@gmail.com>:
> > Hi,
> >
> > Since the post+bind normally happens outside the wt thread, is there a
> way
> > to know the wApp is not yet deleted when you do the binding? For example,
> > can you ask the WServer using the sessionid?
>
> So, yes, actually you need to bind within the event loop, and this
> function is "exported" for a call (usually later) to WServer::post()
>
> Thus:
>
> // Within event loop
> boost::function< void()> function =
> wApp->bind(boost::bind(WWidget::hide, text));
> std::string sessionId = wApp->sessionId();
>
> // Later ...
> WServer::instance()->post(sessionId, function);
>
> Regards,
> koen
>
> PS post scriptum post datum congratulations with the expansion
>

Thanx for the info Koen.
Question 1: I'm unable to bind it in my code within the wt event loop I
guess (or I'm missing something obvious). I want to post-call a method on a
WObject with a parameter, and I only know the parameter in the external
thread. That's why I wanted to do the bind there to a <void (void)> method
and fill the param in. Then do the WApplication bind to make sure the
WObject isn't deleted after the post. Am I missing something? [I worked
around this, but I was hoping to use your code since it simplifies mine :-]

Question 2: in case I would do the binding within the Wt event loop, would
the WObject need to be in the object tree of that WApplication, or may it
have no parent for example?

PS. Thanx for the congrats, though happy with the results we will stop
forking for the time being ... :-]
------------------------------------------------------------------------------
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
_______________________________________________
witty-interest mailing list
witty-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/witty-interest

Reply via email to