# A program with multiple graphics windows.

import ecs10graphics07 as gr

def display(str):
    gr.begin_graphics(500,300,title="Secret", \
                      background = gr.Color.black)
    gr.set_Color(gr.Color.blue)
    gr.text(str,200,150,size=20)
    
    # Loop runs until graphics window is killed
    alive = True
    while alive:
        alive = gr.sleep(.5)
        
    gr.end_graphics()

# Main program; calls display() for every word in a phrase
phrase = "This is the secret message"
wordList = phrase.split(" ")
for word in wordList:
    display(word)
    
raw_input("Press enter to exit.")
