#
#   Basic cursor test
#

from GUI import Window, Image, Cursor, StdCursors, application
from TestViews import TestDrawing
from TestScrollableViews import TestScrollableView

def test():
    file = "grail_masked.tiff"
    #file = "spam_masked.tiff"
    image = Image(file)
    cursor1 = StdCursors.finger
    #cursor1 = StdCursors.poof
    cursor2 = Cursor(image)
    win = Window(title = "Cursor", width = 500, height = 400)
    view1 = TestDrawing(position = (20, 20), size = (100, 70), cursor = cursor1)
    view2 = TestScrollableView(position = (140, 20), size = (200, 200),
        scrolling = 'hv')
    view2.cursor = cursor2
    win.add(view1)
    win.place(view2, sticky = 'nsew')
    win.shrink_wrap((20, 20))
    win.show()

instructions = """
There should be a window containing two views. The cursor should be a
pointing finger over the left view and a grail-shaped beacon over the
right view.

Check that the cursors are properly masked.

Check that the cursor areas remain correct when the window
is resized and the scrolling view is scrolled.
"""

print instructions
test()
application().run()
