













Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!














There are several optional parameters for creating a window:
// Draw a rectangle // Coordinates are relative to the upperleft corner of the window ~r1 = Rect( 100 , 100 , 80 , 30 ); w.drawFunc = { Pen.addRect(~r1); // A path for a rectangle Pen.width = 3 ; Pen.stroke; // Add a stroke (i.e., border) to most recent path }; w.refresh; // Need to redraw the window // Circles/Ovals are defined by a rectangle that can enclose it ~r2 = Rect( 0 , 0 , 40 , 40 ); w.drawFunc = { Pen.fillRect(~r1); // Add and fill a rectangle Pen.addOval(~r2); // Add an oval to the screen Pen.color_(Color.green); // Set the pen color to green Pen.fill; // Fill the most recently added path (i.e., the oval) }; w.refresh; // Clear the screen from drawings w.drawFunc_(nil); // No draw function w.refresh;
~staticText = StaticText.new(w, Rect( 10 , 110 , 100 , 30 )); ~staticText.string = "This is some text"; // set the text ~staticText.align = \center; // center the text ~staticText.stringColor = Color.blue; // Set the text color to blue ~staticText.background = Color.grey; // Set the background to grey
LOW END HIGH END