Boost logo

Boost Users :

From: khuroth (dansilva_at_[hidden])
Date: 2002-08-27 00:03:28


I have a View class that has some widgets, and a Controller class
that controls the view, so the View class has a GetController()
member function that returns a reference to its controller.
When the View's constructor is called, GetController() would return
a bad ref, but it would return a valid reference by the time a
button is clicked... so what I'm trying to do is, inside the View
constructor:

my_button.on_click = bind( (_1 ->* &A::GetController).DoSomething(),
this );

but that obviously doesn't work... I'm even having trouble just
saving the first part:

my_button.on_click = bind<Controller&>(_1 ->* &A::GetController,
this);

also doesn't work...
I tried defining the on_click member of the button as a
boost::function<void> or a boost::function0<void> in the first
example, and a boost::function<Controller&> or
boost::function0<Controller&> in the second snip... I get immense
compiler errors, so I'm not sure where I messed up.

What am I doing wrong?


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net