void OtkWidget::focus(void)
{
-/* if (! _visible)
- return;
-
- XSetInputFocus(otk::OBDisplay::display, _window, RevertToPointerRoot,
- CurrentTime);*/
-
_focused = true;
OtkWidget::OtkWidgetList::iterator it = _children.begin(),
void OtkWidget::render(void)
{
if (!_texture) return;
-
+
_bg_pixmap = _texture->render(_rect.width(), _rect.height(), _bg_pixmap);
- if (_bg_pixmap)
+ if (_bg_pixmap) {
XSetWindowBackgroundPixmap(otk::OBDisplay::display, _window, _bg_pixmap);
- else {
+ _bg_pixel = None;
+ } else {
unsigned int pix = _texture->color().pixel();
if (pix != _bg_pixel) {
_bg_pixel = pix;
void OtkWidget::update(void)
{
if (_dirty) {
- if (! _unmanaged)
adjust();
render();
XClearWindow(OBDisplay::display, _window);
_style = style;
_dirty = true;
- // reset textures/colors
- if (_focused) {
- unfocus();
- focus();
- } else {
- focus();
- unfocus();
- }
-
OtkWidgetList::iterator it, end = _children.end();
for (it = _children.begin(); it != end; ++it)
(*it)->setStyle(style);