Rename the connect function to avoid clashes.

Also connect the dispatcher from the window itself which seems more
natural to do (we are the dispatcher).
This commit is contained in:
Mark de Wever 2009-10-04 14:42:43 +00:00
parent 4a340bc302
commit 3edf2dd3fd
3 changed files with 10 additions and 6 deletions

View file

@ -828,11 +828,8 @@ void tevent_handler::key_down(const SDL_Event& event)
}
#endif
void tevent_handler::connect()
void tevent_handler::connect_signals(twidget& w)
{
twindow& w = get_window();
w.event::tdispatcher::connect();
w.connect_signal<event::SDL_MOUSE_MOTION>(
boost::bind(&tevent_handler::sdl_mouse_motion, this, _2, _5));

View file

@ -489,7 +489,12 @@ public:
public:
void connect();
/**
* Connects the internal signals for the handler.
*
* @param widget The widget to connect the signals to.
*/
void connect_signals(twidget& w);
private:

View file

@ -260,9 +260,11 @@ twindow::twindow(CVideo& video,
tmanager::instance().add(*this);
#ifndef GUI2_OLD_EVENT_HANDLING
tevent_handler::connect();
connect();
#endif
connect_signals(*this);
connect_signal<event::DRAW>(boost::bind(&twindow::draw, this));
connect_signal<event::SDL_VIDEO_RESIZE>(