]>
Dogcows Code - chaz/openbox/blob - otk_test.cc
ccef19fa1b31e0f8eb1f749e993a5d9ebbac6fca
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
);
28 foo
.setTexture(my_style
->getTitleFocus());
29 foo
.setUnfocusTexture(my_style
->getTitleUnfocus());
32 foo
.setDirection(otk::OtkWidget::Horizontal
);
34 otk::OtkFocusWidget
left(&foo
);
35 otk::OtkFocusWidget
right(&foo
);
37 left
.setDirection(otk::OtkWidget::Horizontal
);
38 left
.setStretchableVert(true);
39 left
.setStretchableHorz(true);
40 left
.setTexture(my_style
->getTitleFocus());
41 left
.setUnfocusTexture(my_style
->getTitleUnfocus());
43 right
.setDirection(otk::OtkWidget::Vertical
);
44 right
.setBevelWidth(10);
45 right
.setStretchableVert(true);
47 right
.setTexture(my_style
->getTitleFocus());
48 right
.setUnfocusTexture(my_style
->getTitleUnfocus());
50 otk::OtkButton
iconb(&left
);
51 otk::OtkFocusWidget
label(&left
);
52 otk::OtkButton
maxb(&left
);
53 otk::OtkButton
closeb(&left
);
59 // fix width to 60 and let the height be calculated by its parent
60 //label.setHeight(20);
61 label
.setStretchableVert(true);
62 label
.setStretchableHorz(true);
63 label
.setTexture(my_style
->getLabelFocus());
64 label
.setUnfocusTexture(my_style
->getLabelUnfocus());
70 closeb
.setText("fuubar");
72 otk::OtkFocusWidget
rblef(&right
);
73 otk::OtkButton
rbutt1(&right
);
74 otk::OtkButton
rbutt2(&right
);
76 rblef
.setStretchableHorz(true);
78 rblef
.setTexture(my_style
->getHandleFocus());
79 rblef
.setUnfocusTexture(my_style
->getHandleUnfocus());
81 rbutt1
.setText("this is fucking tight");
82 rbutt2
.setText("heh, WOOP");
84 // will recursively unfocus its children
90 if (XPending(otk::OBDisplay::display
)) {
92 XNextEvent(otk::OBDisplay::display
, &e
);
93 if (e
.type
== Expose
) {
94 foo
.expose(e
.xexpose
);
95 } else if (e
.type
== ConfigureNotify
) {
96 foo
.configure(e
.xconfigure
);
105 otk::OBDisplay::destroy();
This page took 0.039213 seconds and 3 git commands to generate.