mouse(new Input::Mouse(window)),
own_input(true)
{
- set_geometry(Geometry(0, 0, window.get_width(), window.get_height()));
-
- init();
+ init(&window);
}
-Root::Root(const Resources &r, Input::Keyboard *k, Input::Mouse *m):
+Root::Root(const Resources &r, Graphics::Window *window, Input::Keyboard *k, Input::Mouse *m):
resources(r),
keyboard(k),
mouse(m),
own_input(false)
{
- init();
+ init(window);
}
-void Root::init()
+void Root::init(Graphics::Window *window)
{
+ if(window)
+ set_geometry(Geometry(0, 0, window->get_width(), window->get_height()));
+
lbl_tooltip = 0;
tooltip_target = 0;
window's size, and input devices are created automatically. */
Root(const Resources &, Graphics::Window &);
- Root(const Resources &, Input::Keyboard *, Input::Mouse *);
+ /** Creates a Root widget with custom input devices. If window is not null,
+ it is used to set the widget's initial geometry. */
+ Root(const Resources &, Graphics::Window *, Input::Keyboard *, Input::Mouse *);
private:
- void init();
+ void init(Graphics::Window *);
public:
virtual ~Root();