Dialog::setText now takes into account width and height of the window