From: Mikko Rasa Date: Wed, 29 May 2013 20:20:26 +0000 (+0300) Subject: Implement set_size and set_position in terms of set_geometry X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=c2f044fa885deb5a131f19902c88be0bc970ecac;p=libs%2Fgltk.git Implement set_size and set_position in terms of set_geometry --- diff --git a/source/widget.cpp b/source/widget.cpp index bbd2e88..e73e5cf 100644 --- a/source/widget.cpp +++ b/source/widget.cpp @@ -30,18 +30,12 @@ Widget::~Widget() void Widget::set_position(int x, int y) { - geom.x = x; - geom.y = y; - on_geometry_change(); - rebuild(); + set_geometry(Geometry(x, y, geom.w, geom.h)); } void Widget::set_size(unsigned w, unsigned h) { - geom.w = w; - geom.h = h; - on_geometry_change(); - rebuild(); + set_geometry(Geometry(geom.x, geom.y, w, h)); } void Widget::autosize()