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::Application app(argc, argv);
15 otk::AppWidget foo(&app);
18 foo.setTexture(app.getStyle()->titlebarFocusBackground());
19 // foo.setUnfocusTexture(app.getStyle()->titlebarUnfocusBackground());
22 foo.setDirection(otk::Widget::Horizontal);
24 otk::FocusWidget left(&foo);
25 otk::FocusWidget right(&foo);
27 left.setDirection(otk::Widget::Horizontal);
28 left.setStretchableVert(true);
29 left.setStretchableHorz(true);
30 left.setTexture(app.getStyle()->titlebarFocusBackground());
31 left.setUnfocusTexture(app.getStyle()->titlebarUnfocusBackground());
33 right.setDirection(otk::Widget::Vertical);
34 right.setBevelWidth(10);
35 right.setStretchableVert(true);
37 right.setTexture(app.getStyle()->titlebarFocusBackground());
38 right.setUnfocusTexture(app.getStyle()->titlebarUnfocusBackground());
39 otk::Button iconb(&left);
42 /* otk::FocusWidget label(&left);
43 otk::Button maxb(&left);
44 otk::Button 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()->labelFocusBackground());
55 label.setUnfocusTexture(app.getStyle()->labelUnfocusBackground());
61 closeb.setText("fuubar");
63 otk::FocusWidget rblef(&right);
64 otk::Button rbutt1(&right);
65 otk::Button rbutt2(&right);
67 rblef.setStretchableHorz(true);
69 rblef.setTexture(app.getStyle()->handleFocusBackground());
70 rblef.setUnfocusTexture(app.getStyle()->handleUnfocusBackground());
72 rbutt1.setText("this is fucking tight");
73 rbutt2.setText("heh, WOOP");
75 // will recursively unfocus its children