]>
Dogcows Code - chaz/openbox/blob - otk/otk_test.cc
6b4d02505d55304db41b309867a25025f2400535
1 #include "focuswidget.hh"
3 #include "configuration.hh"
4 #include "timerqueuemanager.hh"
9 otk::OBDisplay::initialize(NULL
);
10 otk::Configuration
style_conf(False
);
11 otk::OBTimerQueueManager
*tm
= new otk::OBTimerQueueManager();
12 const otk::ScreenInfo
*s_info
=
13 otk::OBDisplay::screenInfo(DefaultScreen(otk::OBDisplay::display
));
14 otk::BImageControl
*ctrl
= new otk::BImageControl(tm
, s_info
, True
, 4, 5, 200);
16 otk::Style
*my_style
= new otk::Style(ctrl
);
18 const char *sfile
= "/usr/local/share/openbox/styles/artwiz";
20 style_conf
.setFile(sfile
);
23 my_style
->load(style_conf
);
25 otk::OtkFocusWidget
foo(my_style
);
26 otk::OtkFocusWidget
iconb(&foo
);
27 otk::OtkFocusWidget
label(&foo
);
28 otk::OtkFocusWidget
maxb(&foo
);
29 otk::OtkFocusWidget
closeb(&foo
);
33 // fix the width to 400. the height will be determined by the height of
36 foo
.setTexture(my_style
->getTitleFocus());
37 foo
.setUnfocusTexture(my_style
->getTitleUnfocus());
41 iconb
.setTexture(my_style
->getButtonFocus());
42 iconb
.setUnfocusTexture(my_style
->getButtonUnfocus());
44 // fix height to 15 and let the width be calculated by its parent
46 label
.setStretchableHorz(true);
47 label
.setTexture(my_style
->getLabelFocus());
48 label
.setUnfocusTexture(my_style
->getLabelUnfocus());
52 maxb
.setTexture(my_style
->getButtonFocus());
53 maxb
.setUnfocusTexture(my_style
->getButtonUnfocus());
56 closeb
.resize(15, 15);
57 closeb
.setTexture(my_style
->getButtonFocus());
58 closeb
.setUnfocusTexture(my_style
->getButtonUnfocus());
60 // will recursively unfocus its children
65 if (XPending(otk::OBDisplay::display
)) {
67 XNextEvent(otk::OBDisplay::display
, &e
);
75 otk::OBDisplay::destroy();
This page took 0.036466 seconds and 3 git commands to generate.