#!/usr/local/bin/rune -d -x # # Graphical test import "sys"; import ; import ; import ; alias stdio.File *stdout = stdio.stdout; typedef gfx.Event Event; typedef gfx.Frame Frame; typedef gadgets.ButtonFrame Button; subclass Button as MyButton { refine public method void buttonExecute() { stdout->show("BUTTON!", this.text); } } int main(int ac, char **av) { Frame *frame; Frame *frame1; Frame *frame2; MyButton *button; int i; int j; frame.createFrame("BODY", &gfx.root, 1024, 512, BODY); frame->setBGColor(255, 129, 0); for (i = 0; i < 20; ++i) { # Note the use of context-sensitive constants like 'ABOVE'. # Access outside of a method argument would be something # like 'Frame.ABOVE'. # if (i < 10) frame1.createFrame("ABOVE", frame, 0, 0, ABOVE|FILLX); else frame1.createFrame("BELOW", frame, 0, 0, BELOW|FILLX); for (j = 0; j < 10; ++j) { button.createButton(frame1, 0, 0, LEFT, "TestL"); } for (j = 0; j < 10; ++j) { button.createButton(frame1, 0, 0, RIGHT, "TestR"); } } button.createButton(frame, 0, 0, BODY|FILLX|FILLY, "TestM"); frame->recalc(); frame->flush(); Thread.waitThreads(); # wait until all threads have exited return(0); }