1 #include "application.hh"
2 #include "focuswidget.hh"
5 int main(int argc, char **argv) {
6 otk::OtkApplication app(argc, argv);
8 otk::OtkFocusWidget foo(&app);
11 foo.setTexture(app.getStyle()->getTitleFocus());
12 foo.setUnfocusTexture(app.getStyle()->getTitleUnfocus());
15 foo.setDirection(otk::OtkWidget::Horizontal);
17 otk::OtkFocusWidget left(&foo);
18 otk::OtkFocusWidget right(&foo);
20 left.setDirection(otk::OtkWidget::Horizontal);
21 left.setStretchableVert(true);
22 left.setStretchableHorz(true);
23 left.setTexture(app.getStyle()->getTitleFocus());
24 left.setUnfocusTexture(app.getStyle()->getTitleUnfocus());
26 right.setDirection(otk::OtkWidget::Vertical);
27 right.setBevelWidth(10);
28 right.setStretchableVert(true);
30 right.setTexture(app.getStyle()->getTitleFocus());
31 right.setUnfocusTexture(app.getStyle()->getTitleUnfocus());
33 otk::OtkButton iconb(&left);
35 otk::OtkFocusWidget label(&left);
36 otk::OtkButton maxb(&left);
37 otk::OtkButton closeb(&left);
43 // fix width to 60 and let the height be calculated by its parent
44 //label.setHeight(20);
45 label.setStretchableVert(true);
46 label.setStretchableHorz(true);
47 label.setTexture(app.getStyle()->getLabelFocus());
48 label.setUnfocusTexture(app.getStyle()->getLabelUnfocus());
54 closeb.setText("fuubar");
56 otk::OtkFocusWidget rblef(&right);
57 otk::OtkButton rbutt1(&right);
58 otk::OtkButton rbutt2(&right);
60 rblef.setStretchableHorz(true);
62 rblef.setTexture(app.getStyle()->getHandleFocus());
63 rblef.setUnfocusTexture(app.getStyle()->getHandleUnfocus());
65 rbutt1.setText("this is fucking tight");
66 rbutt2.setText("heh, WOOP");
68 // will recursively unfocus its children