summaryrefslogtreecommitdiff
path: root/src/user/rhello
diff options
context:
space:
mode:
authorBenji Dial <benji6283@gmail.com>2021-03-05 18:07:48 -0500
committerBenji Dial <benji6283@gmail.com>2021-03-05 18:07:48 -0500
commit76e39eac8cee2175ec62a191f7c91ca53857e80c (patch)
tree156946f6e8f491235453aa3cbecfda43d6baa2a7 /src/user/rhello
parent5e5e524f08ad653a7bf5d6e97f3a49f6c27d08fa (diff)
downloadportland-os-76e39eac8cee2175ec62a191f7c91ca53857e80c.tar.gz
more raleigh, including button and vbox widgets
Diffstat (limited to 'src/user/rhello')
-rw-r--r--src/user/rhello/main.cpp34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/user/rhello/main.cpp b/src/user/rhello/main.cpp
index 750818c..c92b430 100644
--- a/src/user/rhello/main.cpp
+++ b/src/user/rhello/main.cpp
@@ -1,13 +1,43 @@
#include <raleigh/w/padding.h>
+#include <raleigh/w/button.h>
#include <raleigh/w/label.h>
+#include <raleigh/w/vbox.h>
+
#include <raleigh/runtime.h>
#include <raleigh/window.h>
+#include <popups/info.h>
+#include <pland/pcrt.h>
+
using namespace raleigh;
+window *p_w;
+
+void onclick(button &from) {
+ p_w->show();
+}
+
void main() {
label l("Hello, world! Close me with Alt+F4.");
- padding p(4, RGB(bf, bf, bf), l);
- window w(p);
+ padding pl(l, 2);
+
+ label bl("Click me!");
+ padding pbl(bl, 4);
+ button b(pbl, &onclick);
+ padding pb(b, 2);
+
+ dllist<widget &> wl;
+ wl.add_front(pb);
+ wl.add_front(pl);
+ vbox vb(wl);
+ padding pvb(vb, 2);
+
+ window w(pvb, RGB(bf, bf, bf), (bool (*)(window &))&__pcrt_quit);
+
+ label p_l("You clicked that button!");
+ padding p_pl(p_l, 4);
+ p_w = new window(p_pl);
+
+ w.show();
start_runtime();
} \ No newline at end of file