import sys
from PyQt4.QtCore import QSize
from PyQt4.QtGui import QApplication
from qzion import QZionCanvas
from qedje import QEdje


if __name__ == "__main__":
    app = QApplication(sys.argv)
    canvas = QZionCanvas()
    canvas.show()

    if len(sys.argv) >= 2:
        filename = sys.argv[1]
    else:
        filename = "../../tests/collections/theme2.edj"

    if len(sys.argv) >= 3:
        group = sys.argv[2]
    else:
        group = "world"

    world = QEdje(canvas, filename, group)
    world.show()

    def fun():
        print "Clicked!"

    world.connectEdjeSignal("mouse,clicked,1", "*", fun)

    sys.exit(app.exec_())
