diff options
Diffstat (limited to 'src/user/rhello')
-rw-r--r-- | src/user/rhello/main.cpp | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/user/rhello/main.cpp b/src/user/rhello/main.cpp index 22b4fd5..8ea0bf0 100644 --- a/src/user/rhello/main.cpp +++ b/src/user/rhello/main.cpp @@ -3,6 +3,7 @@ #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> @@ -16,6 +17,7 @@ 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(); @@ -25,23 +27,37 @@ void onclick(button &from) { p_w->show(); } +void onclick2(button &from) { + l->change_value("I can be changed on the fly."); +} + void main() { - label l("Hello, world! Close me with Alt+F4."); - padding pl(l, 2); + 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); - entry e(8, 31, "This window is made with the Raleigh widget toolkit for Portland OS.\n\nI am a text entry widget. My cursor can be used, but editing is not yet implemented."); + 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(pb); + wl.add_front(bb); wl.add_front(pcp); wl.add_front(pe); wl.add_front(pl); |