]>
Dogcows Code - chaz/openbox/blob - otk/otk_test.cc
e81b777d4d6eb300f275da1b89e860417ee7fbcf
1 #include "focuswidget.hh"
4 #include "configuration.hh"
5 #include "timerqueuemanager.hh"
11 otk::OBDisplay::initialize(NULL
);
12 otk::Configuration
style_conf(False
);
13 otk::OBTimerQueueManager
*tm
= new otk::OBTimerQueueManager();
14 const otk::ScreenInfo
*s_info
=
15 otk::OBDisplay::screenInfo(DefaultScreen(otk::OBDisplay::display
));
16 otk::BImageControl
*ctrl
= new otk::BImageControl(tm
, s_info
, True
, 4, 5, 200);
18 otk::Style
*my_style
= new otk::Style(ctrl
);
20 style_conf
.setFile("/usr/local/share/openbox/styles/artwiz");
23 my_style
->load(style_conf
);
25 otk::OtkFocusWidget
foo(my_style
);
26 otk::OtkButton
iconb(&foo
);
27 otk::OtkFocusWidget
label(&foo
);
28 otk::OtkButton
maxb(&foo
);
29 otk::OtkButton
closeb(&foo
);
32 foo
.setDirection(otk::OtkWidget::Vertical
);
35 foo
.setTexture(my_style
->getTitleFocus());
36 foo
.setUnfocusTexture(my_style
->getTitleUnfocus());
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());
52 closeb
.setText("fuubar");
54 // will recursively unfocus its children
60 if (XPending(otk::OBDisplay::display
)) {
62 XNextEvent(otk::OBDisplay::display
, &e
);
63 if (e
.type
== Expose
) {
64 foo
.expose(e
.xexpose
);
65 } else if (e
.type
== ConfigureNotify
) {
66 std::cout
<< "configure\n";
67 foo
.configure(e
.xconfigure
);
76 otk::OBDisplay::destroy();
This page took 0.039489 seconds and 4 git commands to generate.