diff options
author | Benji Dial <benji6283@gmail.com> | 2021-03-11 22:00:22 -0500 |
---|---|---|
committer | Benji Dial <benji6283@gmail.com> | 2021-03-11 22:00:22 -0500 |
commit | 5fcf57739e68a8b5053e03778aaee0eed445babd (patch) | |
tree | e7a8bab18668d112e58b1b48190195035c71fa8a /src/user/mkpopup/main.cpp | |
parent | 0f2398d1f622cce37925f52d978d92e6cce1c7a9 (diff) | |
download | portland-os-5fcf57739e68a8b5053e03778aaee0eed445babd.tar.gz |
settings editor, and lots of changes in service of that
Diffstat (limited to 'src/user/mkpopup/main.cpp')
-rw-r--r-- | src/user/mkpopup/main.cpp | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/user/mkpopup/main.cpp b/src/user/mkpopup/main.cpp new file mode 100644 index 0000000..5e3310c --- /dev/null +++ b/src/user/mkpopup/main.cpp @@ -0,0 +1,43 @@ +#include <raleigh/w/padding.h> +#include <raleigh/w/label.h> +#include <raleigh/w/vbox.h> +#include <raleigh/window.h> +#include <knob/block.h> + +using namespace raleigh; + +widget *make_line(const char *str) { + return new label(str); +} + +void main(const char *text) { + dllist<widget &> box_widgets; + + char *const data = strdup(text); + + char *this_string = data; + while (*this_string) { + char *i = this_string; + while (1) { + if (!i[0]) { + box_widgets.add_back(*make_line(this_string)); + this_string = i; + break; + } + if ((i[0] == '\\') && (i[1] == 'n')) { + i[0] = '\0'; + box_widgets.add_back(*make_line(this_string)); + this_string = i + 2; + break; + } + ++i; + } + } + + vbox box(box_widgets); + padding p(box, 4); + window w(p); + + w.show(); + start_runtime(); +}
\ No newline at end of file |