import os
from World import *

class Hello(Gui):
    def __init__(self, debug=False):
        Gui.__init__(self, debug)
        self.ca_width = 400
        self.ca_height = 400

    def setup(self):
        """setup creates the GUI elements (called widgets)"""
        
        # left frame
        self.fr(LEFT)
        self.canvas = self.ca(width=self.ca_width, height=self.ca_height,
                              bg='white')
        self.endfr()

        # right frame
        self.fr(LEFT)

        self.fr(TOP)
        self.bu(TOP, text='Quit', command=self.quit)
        self.bu(TOP, text='Hello', command=self.hello)
        self.endfr()

        self.endfr()

    def hello(self):
        self.canvas.text([0, 0], 'Hello')

if __name__ == '__main__':

    # configure Lumpy
    import Lumpy
    lumpy = Lumpy.Lumpy()
    lumpy.transparent_class(Gui)
    lumpy.transparent_class(Tk)
    lumpy.transparent_class(Wm)
    lumpy.transparent_class(Misc)
    lumpy.make_reference()
    
    # create the GUI
    h = Hello()
    h.setup()

    if True:
        lumpy.object_diagram()
        lumpy.class_diagram()

    # wait for user events
    h.mainloop()
