//Using bind with Boost.Function class button { public: boost::functiononClick; }; class player { public: void play(); void stop(); }; button playButton, stopButton; player thePlayer; void connect() { playButton.onClick = boost::bind(&player::play, &thePlayer); stopButton.onClick = boost::bind(&player::stop, &thePlayer); }
pretty neat doesn't it? :)
Tidak ada komentar:
Posting Komentar