#!/usr/local/bin/python ## # Resizing Windows # ---------------- # This program makes use of the resize function to change the # size of a window. # # The resize function can be used with controls as well as # windows, so that buttons, text fields and textboxes can # be moved or resized when the window is resized. ## from graphapp import * def main(): w = newwindow("Resize this Window", rect(100,100,300,250), Titlebar + Closebox + Minimize) b1 = newbutton("Bigger", rect(10,10,80,30), bigger) b2 = newbutton("Smaller", rect(10,50,80,30), smaller) show(w) mainloop() def bigger(b): resize(parentwindow(b), rect(100,100,400,300)) def smaller(b): resize(parentwindow(b), rect(100,100,200,150)) main()