- parent->addChild(this);
- create();
-}
-
-OtkWidget::OtkWidget(OtkApplication *app, Direction direction,
- Cursor cursor, int bevel_width)
- : OtkEventHandler(),
- _parent(0), _style(app->getStyle()), _direction(direction), _cursor(cursor),
- _bevel_width(bevel_width), _ignore_config(0), _visible(false),
- _focused(false), _grabbed_mouse(false), _grabbed_keyboard(false),
- _stretchable_vert(false), _stretchable_horz(false), _texture(0),
- _bg_pixmap(0), _bg_pixel(0), _screen(app->getStyle()->getScreen()),
- _fixed_width(false), _fixed_height(false), _dirty(false)
-{
- assert(app);
- create();
- app->registerHandler(_window, this);
-}
-
-OtkWidget::OtkWidget(Style *style, Direction direction,
- Cursor cursor, int bevel_width)
- : OtkEventHandler(),
- _parent(0), _style(style), _direction(direction), _cursor(cursor),
- _bevel_width(bevel_width), _ignore_config(0), _visible(false),
- _focused(false), _grabbed_mouse(false), _grabbed_keyboard(false),
- _stretchable_vert(false), _stretchable_horz(false), _texture(0),
- _bg_pixmap(0), _bg_pixel(0), _screen(style->getScreen()),
- _fixed_width(false), _fixed_height(false), _dirty(false)
+ createWindow(overrideredir);
+ _dispatcher->registerHandler(_window, this);
+}
+
+Widget::Widget(Widget *parent, Direction direction, int bevel)
+ : _texture(0),
+ _screen(parent->_screen),
+ _parent(parent),
+ _window(0),
+ _surface(0),
+ _event_mask(ButtonPressMask | ButtonReleaseMask | ButtonMotionMask |
+ ExposureMask | StructureNotifyMask),
+ _alignment(RenderStyle::CenterJustify),
+ _direction(direction),
+ _max_size(UINT_MAX, UINT_MAX),
+ _visible(false),
+ _bordercolor(0),
+ _borderwidth(0),
+ _bevel(bevel),
+ _dirty(true),
+ _dispatcher(parent->_dispatcher),
+ _ignore_config(0)