diff options
| author | Marius Nita <marius@cs.pdx.edu> | 2002-11-16 09:59:37 +0000 |
|---|---|---|
| committer | Marius Nita <marius@cs.pdx.edu> | 2002-11-16 09:59:37 +0000 |
| commit | 6f5e60f0337e60d904a8f549aeaa631afefc8033 (patch) | |
| tree | 2060d3507234f518d6540486e8567cae78036b2c /otk/application.cc | |
| parent | 0680daeef57748af17e0462def4852d408a62eb6 (diff) | |
fixed bugs, got otkapp to select on a fd, modded widget to make use of otkapp, press/release events on buttons
Diffstat (limited to 'otk/application.cc')
| -rw-r--r-- | otk/application.cc | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/otk/application.cc b/otk/application.cc index 92d6dfd2..efe6ad85 100644 --- a/otk/application.cc +++ b/otk/application.cc @@ -1,6 +1,8 @@ #include "application.hh" #include "eventhandler.hh" +#include <iostream> + namespace otk { OtkApplication::OtkApplication(int argc, char **argv) @@ -35,12 +37,23 @@ void OtkApplication::loadStyle(void) // find the style name as a property _style_conf->setFile("/usr/local/share/openbox/styles/artwiz"); _style_conf->load(); - _style->load(_style_conf); + _style->load(*_style_conf); } void OtkApplication::exec(void) { - dispatchEvents(); + const int xfd = ConnectionNumber(OBDisplay::display); + fd_set rfds; + timeval *timeout = 0; + + while (1) { + dispatchEvents(); + + FD_ZERO(&rfds); + FD_SET(xfd, &rfds); + + select(xfd + 1, &rfds, 0, 0, timeout); + } } } |
