summaryrefslogtreecommitdiff
path: root/lib/glwidgets.cc
diff options
context:
space:
mode:
authorpixel <pixel>2003-03-17 07:44:36 +0000
committerpixel <pixel>2003-03-17 07:44:36 +0000
commit05d399c049f3f8a84bbc2e81f1636c911cec7e26 (patch)
tree2ddeeec028a60009731785e327bc174357f2987e /lib/glwidgets.cc
parenta0ec1cffa6b75030344632083b2b1b63c0cfcf0a (diff)
Widgets
Diffstat (limited to 'lib/glwidgets.cc')
-rw-r--r--lib/glwidgets.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/glwidgets.cc b/lib/glwidgets.cc
index b381092..56b8e2f 100644
--- a/lib/glwidgets.cc
+++ b/lib/glwidgets.cc
@@ -3,8 +3,38 @@
#include "glfont.h"
#include "glwidgets.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifndef _
+#define _(x) x
+#endif
+
mogltk::widget::widget() {
}
+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."));
+
+ next = father->child;
+ prev = 0;
+ father->child = this;
+ child = 0;
+ root = father->root;
+}
+
mogltk::widget::~widget() {
+ while(child)
+ delete child;
+
+ if (prev)
+ prev->next = next;
+ else if (father)
+ father->child = next;
+
+ if (next)
+ next->prev = prev;
}