from GUI import Window, View, Image, application
from GUI.Geometry import offset_rect, rect_sized

class ImageTestView(View):

    def draw(self, c):
        main_image_pos = (10, 10)
        src_rect = image.bounds
        dst_rect = offset_rect(src_rect, main_image_pos)
        image.draw(c, src_rect, dst_rect)
        src_rect = rect_sized((180, 160), (100, 100))
        c.frame_rect(offset_rect(src_rect, main_image_pos))
        dst_rect = rect_sized((10, 340), (150, 150))
        image.draw(c, src_rect, dst_rect)
        dst_rect = rect_sized((200, 340), (100, 100))
        image.draw(c, src_rect, dst_rect)
        dst_rect = rect_sized((340, 340), (50, 50))
        image.draw(c, src_rect, dst_rect)

image = Image(file = "imac.jpg")

win = Window(size = (500, 500))
view = ImageTestView(size = win.size)
win.add(view)
win.show()

application().run()
