2 #include "focuswidget.hh"
4 #include "configuration.hh"
5 #include "timerqueuemanager.hh"
10 otk::OBDisplay::initialize(NULL);
11 otk::Configuration style_conf(False);
12 otk::OBTimerQueueManager *tm = new otk::OBTimerQueueManager();
13 const otk::ScreenInfo *s_info =
14 otk::OBDisplay::screenInfo(DefaultScreen(otk::OBDisplay::display));
15 otk::BImageControl *ctrl = new otk::BImageControl(tm, s_info, True, 4, 5, 200);
17 otk::Style *my_style = new otk::Style(ctrl);
19 style_conf.setFile("/usr/local/share/openbox/styles/artwiz");
22 my_style->load(style_conf);
24 otk::OtkFocusWidget foo(my_style);
25 otk::OtkFocusWidget iconb(&foo);
26 otk::OtkFocusWidget label(&foo);
27 otk::OtkFocusWidget maxb(&foo);
28 otk::OtkFocusWidget closeb(&foo);
31 foo.setDirection(otk::OtkWidget::Vertical);
34 foo.setTexture(my_style->getTitleFocus());
35 foo.setUnfocusTexture(my_style->getTitleUnfocus());
39 iconb.setTexture(my_style->getButtonFocus());
40 iconb.setUnfocusTexture(my_style->getButtonUnfocus());
42 // fix width to 60 and let the height be calculated by its parent
44 label.setStretchableVert(true);
45 label.setTexture(my_style->getLabelFocus());
46 label.setUnfocusTexture(my_style->getLabelUnfocus());
50 maxb.setTexture(my_style->getButtonFocus());
51 maxb.setUnfocusTexture(my_style->getButtonUnfocus());
54 closeb.resize(15, 15);
55 closeb.setTexture(my_style->getButtonFocus());
56 closeb.setUnfocusTexture(my_style->getButtonUnfocus());
58 // will recursively unfocus its children
63 if (XPending(otk::OBDisplay::display)) {
65 XNextEvent(otk::OBDisplay::display, &e);
73 otk::OBDisplay::destroy();