summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-24 08:56:20 +0000
committerpixel <pixel>2003-03-24 08:56:20 +0000
commitc1057d096fa2e1421d881732922a929829799263 (patch)
treead4428a92b1776d80fbbfaf144a7d0e8612a1b96 /lib
parentc133f790e21a86c30584abe67b18297b29039209 (diff)
Bleh
Diffstat (limited to 'lib')
-rw-r--r--lib/glwidgets.cc17
1 files changed, 11 insertions, 6 deletions
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() {