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);
34 otk::OtkFocusWidget label(&left);
35 otk::OtkButton maxb(&left);
36 otk::OtkButton closeb(&left);
42 // fix width to 60 and let the height be calculated by its parent
43 //label.setHeight(20);
44 label.setStretchableVert(true);
45 label.setStretchableHorz(true);
46 label.setTexture(app.getStyle()->getLabelFocus());
47 label.setUnfocusTexture(app.getStyle()->getLabelUnfocus());
53 closeb.setText("fuubar");
55 otk::OtkFocusWidget rblef(&right);
56 otk::OtkButton rbutt1(&right);
57 otk::OtkButton rbutt2(&right);
59 rblef.setStretchableHorz(true);
61 rblef.setTexture(app.getStyle()->getHandleFocus());
62 rblef.setUnfocusTexture(app.getStyle()->getHandleUnfocus());
64 rbutt1.setText("this is fucking tight");
65 rbutt2.setText("heh, WOOP");
67 // will recursively unfocus its children