#!/usr/local/bin/python ## # Lines2 # ------ # This is another version of the lines.c program. It draws some # lines inside a call-back so they will not be erased by the # window becoming obscured. # # The setredraw function associates a redraw call-back with a # window, before the window is made visible by calling show. ## from graphapp import * def draw_it(w, r): A = pt(10,10) B = pt(10,40) C = pt(50,40) drawline(A, B) drawline(B, C) drawline(C, A) def main(): w = newwindow("Graphics", rect(20,20,100,80), StandardWindow) setredraw(w, draw_it) show(w) mainloop() main()