From c1057d096fa2e1421d881732922a929829799263 Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 24 Mar 2003 08:56:20 +0000 Subject: Bleh --- lib/glwidgets.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'lib') diff --git a/lib/glwidgets.cc b/lib/glwidgets.cc index 56b8e2f..0ac5f8b 100644 --- a/lib/glwidgets.cc +++ b/lib/glwidgets.cc @@ -11,19 +11,24 @@ #define _(x) x #endif -mogltk::widget::widget() { -} +mogltk::widget * mogltk::widget::cur_root = 0; mogltk::widget::widget(widget * _father, int _x, int _y, int _sx, int _sy) throw (GeneralException) : x(_x), y(_y), sx(_sx), sy(_sy), father(_father) { + if (!father) - throw GeneralException(_("No father. Only root can be adam.")); + father = cur_root; - next = father->child; + if (father) { + next = father->child; + father->child = this; + root = father->root; + } else { + next = 0; + cur_root = root = this; + } prev = 0; - father->child = this; child = 0; - root = father->root; } mogltk::widget::~widget() { -- cgit v1.2.3