update_style();
- mouse->signal_button_press.connect(sigc::mem_fun(this, &Root::button_press_event));
- mouse->signal_button_release.connect(sigc::mem_fun(this, &Root::button_release_event));
- mouse->signal_axis_motion.connect(sigc::mem_fun(this, &Root::axis_motion_event));
- keyboard->signal_button_press.connect(sigc::mem_fun(this, &Root::key_press_event));
- keyboard->signal_button_release.connect(sigc::mem_fun(this, &Root::key_release_event));
- keyboard->signal_character.connect(sigc::mem_fun(this, &Root::character_event));
+ if(mouse)
+ {
+ mouse->signal_button_press.connect(sigc::mem_fun(this, &Root::button_press_event));
+ mouse->signal_button_release.connect(sigc::mem_fun(this, &Root::button_release_event));
+ mouse->signal_axis_motion.connect(sigc::mem_fun(this, &Root::axis_motion_event));
+ }
+
+ if(keyboard)
+ {
+ keyboard->signal_button_press.connect(sigc::mem_fun(this, &Root::key_press_event));
+ keyboard->signal_button_release.connect(sigc::mem_fun(this, &Root::key_release_event));
+ keyboard->signal_character.connect(sigc::mem_fun(this, &Root::character_event));
+ }
}
Root::~Root()