""" Demonstration of the Pmw ScrolledCanvas megawidget.
"""

# Import Pmw from the sibling directory.
import sys
sys.path[:0] = ['../../..']

import os
import Tkinter
import Pmw

class Demo:
    def __init__(self, parent):
	# Create and pack the ScrolledCanvas.
	sc = Pmw.ScrolledCanvas(parent, width = 600, height = 500)
	sc.pack(padx=10, pady=10, fill='both', expand='yes')

	sc.create_line(10, 10, 100, 100)
	sc.create_oval(100, 100, 300, 200, fill = 'red')
	sc.create_oval(500, 400, 600, 500, fill = 'blue')

######################################################################

# Create demo in root window for testing.
if __name__ == '__main__':
    root = Tkinter.Tk()
    Pmw.initialise(root, fontScheme = 'pmw1')
    root.title('Pmw ScrolledCanvas demonstration')

    exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy)
    exitButton.pack(side = 'bottom')
    widget = Demo(root)
    root.mainloop()
