// Programm: window_demo.C // Demo program for libwindow. #include #include int main() { // draw point with coordinates (100, 200) wio << Point(100, 200); // draw line segment (200, 200) -> (300, 300) wio << Line(200, 200, 300, 300); // draw green circle around (150, 150) with radius 20 wio << green << FilledCircle(150, 150, 20) << flush; // draw blue ellipse around (250, 200) with width 100 and height 50 wio << blue << Ellipse(250, 200, 100, 50); // buffer flush (necessary to make changes visible) wio << flush; // wait for a second (10^6 microsec.) wio.wait(1000000); // continue the segment from above as line in red wio << red << Line(100, 100, 200, 200) << flush; // wait for mouse click std::cout << "Waiting for mouse click." << std::endl; wio.wait_for_mouse_click(); // clear window wio << clear; // read a filled rectangle std::cout << "Please input a rectangle." << std::endl; FilledRectangle r; wio >> r; // and draw it wio << black << r << flush; // wait for right mouse click std::cout << "Waiting for right mouse click." << std::endl; wio.wait_for_mouse_click(3); }