]>
Dogcows Code - chaz/openbox/blob - otk/otk_test.cc
1 // -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*-
4 # include "../config.h"
7 #include "application.hh"
8 #include "focuswidget.hh"
9 #include "appwidget.hh"
12 int main(int argc
, char **argv
) {
13 otk::OtkApplication
app(argc
, argv
);
15 otk::OtkAppWidget
foo(&app
);
18 foo
.setTexture(app
.getStyle()->getTitleFocus());
19 // foo.setUnfocusTexture(app.getStyle()->getTitleUnfocus());
22 foo
.setDirection(otk::OtkWidget::Horizontal
);
24 otk::OtkFocusWidget
left(&foo
);
25 otk::OtkFocusWidget
right(&foo
);
27 left
.setDirection(otk::OtkWidget::Horizontal
);
28 left
.setStretchableVert(true);
29 left
.setStretchableHorz(true);
30 left
.setTexture(app
.getStyle()->getTitleFocus());
31 left
.setUnfocusTexture(app
.getStyle()->getTitleUnfocus());
33 right
.setDirection(otk::OtkWidget::Vertical
);
34 right
.setBevelWidth(10);
35 right
.setStretchableVert(true);
37 right
.setTexture(app
.getStyle()->getTitleFocus());
38 right
.setUnfocusTexture(app
.getStyle()->getTitleUnfocus());
40 otk::OtkButton
iconb(&left
);
42 otk::OtkFocusWidget
label(&left
);
43 otk::OtkButton
maxb(&left
);
44 otk::OtkButton
closeb(&left
);
50 // fix width to 60 and let the height be calculated by its parent
51 //label.setHeight(20);
52 label
.setStretchableVert(true);
53 label
.setStretchableHorz(true);
54 label
.setTexture(app
.getStyle()->getLabelFocus());
55 label
.setUnfocusTexture(app
.getStyle()->getLabelUnfocus());
61 closeb
.setText("fuubar");
63 otk::OtkFocusWidget
rblef(&right
);
64 otk::OtkButton
rbutt1(&right
);
65 otk::OtkButton
rbutt2(&right
);
67 rblef
.setStretchableHorz(true);
69 rblef
.setTexture(app
.getStyle()->getHandleFocus());
70 rblef
.setUnfocusTexture(app
.getStyle()->getHandleUnfocus());
72 rbutt1
.setText("this is fucking tight");
73 rbutt2
.setText("heh, WOOP");
75 // will recursively unfocus its children
This page took 0.039674 seconds and 4 git commands to generate.