diff options
author | Benji Dial <benji6283@gmail.com> | 2021-03-05 18:07:48 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-03-05 18:07:48 -0500 |
commit | 76e39eac8cee2175ec62a191f7c91ca53857e80c (patch) | |
tree | 156946f6e8f491235453aa3cbecfda43d6baa2a7 /src/user/include/cxx/raleigh/window.h | |
parent | 5e5e524f08ad653a7bf5d6e97f3a49f6c27d08fa (diff) | |
download | portland-os-76e39eac8cee2175ec62a191f7c91ca53857e80c.tar.gz |
more raleigh, including button and vbox widgets
Diffstat (limited to 'src/user/include/cxx/raleigh/window.h')
-rw-r--r-- | src/user/include/cxx/raleigh/window.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/user/include/cxx/raleigh/window.h b/src/user/include/cxx/raleigh/window.h index 7e45e22..f82f9a9 100644 --- a/src/user/include/cxx/raleigh/window.h +++ b/src/user/include/cxx/raleigh/window.h @@ -5,22 +5,30 @@ namespace raleigh { class window; } +#include <raleigh/runtime.h> #include <raleigh/widget.h> #include <pland/syscall.h> #include <raleigh/util.h> namespace raleigh { class window { + friend void start_runtime(); public: - window(widget &root); + //pass on_close to specify a close handler. if on_close returns false, the window will not be closed. + window(widget &root, _pixel_t bg_color=RGB(bf, bf, bf), bool (*on_close)(window &)=0); void notify_needs_paint(widget &from); enum try_actions_return_t {NONE, GOOD, DELETE}; try_actions_return_t try_actions(); + void show(); private: _window_handle_t handle; _pixel_t *pixbuf; coord size; widget &root; + _pixel_t bg_color; + bool needs_repaint; + void paint_full(); + bool (*on_close)(window &); }; } |