diff options
Diffstat (limited to 'src/user/rhello')
-rw-r--r-- | src/user/rhello/main.cpp | 75 |
1 files changed, 0 insertions, 75 deletions
diff --git a/src/user/rhello/main.cpp b/src/user/rhello/main.cpp deleted file mode 100644 index 8ea0bf0..0000000 --- a/src/user/rhello/main.cpp +++ /dev/null @@ -1,75 +0,0 @@ -#include <raleigh/w/colorpicker.h> -#include <raleigh/w/padding.h> -#include <raleigh/w/button.h> -#include <raleigh/w/label.h> -#include <raleigh/w/entry.h> -#include <raleigh/w/hbox.h> -#include <raleigh/w/vbox.h> - -#include <raleigh/runtime.h> -#include <raleigh/window.h> - -#include <knob/format.h> -#include <pland/pcrt.h> - -using namespace raleigh; - -colorpicker *cp; -label *p_l; -window *p_w; -label *l; - -void onclick(button &from) { - const _pixel_t pc = cp->get_picked_color(); - char *const text = format("Selected color is #%2x%2x%2x", pc.r, pc.g, pc.b); - p_l->change_value(text); - free_block(text); - p_w->show(); -} - -void onclick2(button &from) { - l->change_value("I can be changed on the fly."); -} - -void main() { - l = new label("Hello, world! Close me with Alt+F4."); - padding pl(*l, 2); - - label bl("Click me!"); - padding pbl(bl, 4); - button b(pbl, &onclick); - padding pb(b, 2); - - label b2l("Click me too!"); - padding pb2l(b2l, 4); - button b2(pb2l, &onclick2); - padding pb2(b2, 2); - - dllist<widget &> bbl; - bbl.add_front(pb2); - bbl.add_front(pb); - hbox bb(bbl); - - entry e(8, 31, "This window is made with the Raleigh widget toolkit for Portland OS.\n\nI am a text entry widget. You can move my cursor, but I cannot yet be edited."); - padding pe(e, 2); - - cp = new colorpicker(); - padding pcp(*cp, 2); - - dllist<widget &> wl; - wl.add_front(bb); - wl.add_front(pcp); - wl.add_front(pe); - wl.add_front(pl); - vbox vb(wl); - padding pvb(vb, 2); - - window w(pvb, RGB(bf, bf, bf), (bool (*)(window &))&__pcrt_quit); - - p_l = new label(""); - padding p_pl(*p_l, 4); - p_w = new window(p_pl); - - w.show(); - start_runtime(); -}
\ No newline at end of file |