# # Cleaned-up in class version # from graphics import * # Build the window. def windowBuild(): """ Create the window and a text message, and return both as a tuple. """ window = GraphWin("Something worth remembering.", 300, 300) window.setBackground("grey") message = Text(Point (150,150), "Feeling tired lately? Click in the window.") message.draw(window) return (window, message) # Create the message and a method to display it def clickMess(win): # Now create the all-importaant message. taDa = "Wrap up what you're doing and let yourself get some sleep." # Check the mouse. wait = win.getMouse() newText = Text(Point(200,200), taDa) newText.setFill("Cyan") newText.draw(win) # Set up an exit for the program def exitSleep(win, text): text.setText( "Click anywhere in the window to exit, so you can get that sleep.") win.getMouse() def main(): (win, text) = windowBuild() clickMess(win) exitSleep(win, text) main()