#!/usr/local/bin/python ## # Labels # ------ # This program demonstates the use of text labels. # # Labels display text on a window. The words in the label are # automatically redrawn when a window is resized or redrawn. ## from graphapp import * def quit(b): exitapp() def main(): w = newwindow("Question", rect(0,0,200,180), StandardWindow) title = newlabel("GraphApp!", rect(10,10,180,40), Center) settextfont(title, Courier) question = newlabel("Are you happy?", rect(10,60,180,40), AlignLeft) b = newbutton("Yes", rect(100,120,80,40), quit) show(w) mainloop() main()