diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2002-11-16 02:15:49 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2002-11-16 02:15:49 +0000 |
| commit | a3d036f60ed2333622ee9b61dbddcdc8fbc497c3 (patch) | |
| tree | dae05770ec9c7aab9529e57361cb7b87f956de0f /otk/otk_test.cc | |
| parent | e53fbcf092c40b22ccc4c5f23795e12c9862c338 (diff) | |
added otkapplication and event stuff, changed other files to accomodate for this, changed the test.
no idea if anything runs yet. it compiles =)
Diffstat (limited to 'otk/otk_test.cc')
| -rw-r--r-- | otk/otk_test.cc | 65 |
1 files changed, 16 insertions, 49 deletions
diff --git a/otk/otk_test.cc b/otk/otk_test.cc index ccef19fa..ec352f9f 100644 --- a/otk/otk_test.cc +++ b/otk/otk_test.cc @@ -1,32 +1,15 @@ +#include "application.hh" #include "focuswidget.hh" #include "button.hh" -#include "display.hh" -#include "configuration.hh" -#include "timerqueuemanager.hh" -#include "image.hh" -#include "style.hh" -#include <iostream> -int main(void) { - otk::OBDisplay::initialize(NULL); - otk::Configuration style_conf(False); - otk::OBTimerQueueManager *tm = new otk::OBTimerQueueManager(); - const otk::ScreenInfo *s_info = - otk::OBDisplay::screenInfo(DefaultScreen(otk::OBDisplay::display)); - otk::BImageControl *ctrl = new otk::BImageControl(tm, s_info, True, 4, 5, 200); +int main(int argc, char **argv) { + otk::OtkApplication app(argc, argv); - otk::Style *my_style = new otk::Style(ctrl); - - style_conf.setFile("/usr/local/share/openbox/styles/artwiz"); - style_conf.load(); - - my_style->load(style_conf); - - otk::OtkFocusWidget foo(my_style); + otk::OtkFocusWidget foo(&app); foo.resize(600, 500); - foo.setTexture(my_style->getTitleFocus()); - foo.setUnfocusTexture(my_style->getTitleUnfocus()); + foo.setTexture(app.getStyle()->getTitleFocus()); + foo.setUnfocusTexture(app.getStyle()->getTitleUnfocus()); foo.setBevelWidth(2); foo.setDirection(otk::OtkWidget::Horizontal); @@ -37,15 +20,15 @@ int main(void) { left.setDirection(otk::OtkWidget::Horizontal); left.setStretchableVert(true); left.setStretchableHorz(true); - left.setTexture(my_style->getTitleFocus()); - left.setUnfocusTexture(my_style->getTitleUnfocus()); + left.setTexture(app.getStyle()->getTitleFocus()); + left.setUnfocusTexture(app.getStyle()->getTitleUnfocus()); right.setDirection(otk::OtkWidget::Vertical); right.setBevelWidth(10); right.setStretchableVert(true); right.setWidth(300); - right.setTexture(my_style->getTitleFocus()); - right.setUnfocusTexture(my_style->getTitleUnfocus()); + right.setTexture(app.getStyle()->getTitleFocus()); + right.setUnfocusTexture(app.getStyle()->getTitleUnfocus()); otk::OtkButton iconb(&left); otk::OtkFocusWidget label(&left); @@ -60,8 +43,8 @@ int main(void) { //label.setHeight(20); label.setStretchableVert(true); label.setStretchableHorz(true); - label.setTexture(my_style->getLabelFocus()); - label.setUnfocusTexture(my_style->getLabelUnfocus()); + label.setTexture(app.getStyle()->getLabelFocus()); + label.setUnfocusTexture(app.getStyle()->getLabelUnfocus()); // fixed size maxb.setText("bar"); @@ -75,34 +58,18 @@ int main(void) { rblef.setStretchableHorz(true); rblef.setHeight(50); - rblef.setTexture(my_style->getHandleFocus()); - rblef.setUnfocusTexture(my_style->getHandleUnfocus()); + rblef.setTexture(app.getStyle()->getHandleFocus()); + rblef.setUnfocusTexture(app.getStyle()->getHandleUnfocus()); rbutt1.setText("this is fucking tight"); rbutt2.setText("heh, WOOP"); // will recursively unfocus its children //foo.unfocus(); - foo.update(); + foo.show(); - while (1) { - if (XPending(otk::OBDisplay::display)) { - XEvent e; - XNextEvent(otk::OBDisplay::display, &e); - if (e.type == Expose) { - foo.expose(e.xexpose); - } else if (e.type == ConfigureNotify) { - foo.configure(e.xconfigure); - } - } - } - - delete my_style; - delete tm; - delete ctrl; - - otk::OBDisplay::destroy(); + app.exec(); return 0; } |
