#this import statement allows access to the karamba functions import karamba #this is called when you widget is initialized def initWidget(widget): pass #this is called everytime your widget is updated #the update inverval is specified in the .theme file def widgetUpdated(widget): pass #This gets called everytime our widget is clicked. #Notes: # widget = reference to our widget # x = x position (relative to our widget) # y = y position (relative to our widget) # botton = button clicked: # 1 = Left Mouse Button # 2 = Middle Mouse Button # 3 = Right Mouse Button, but this will never happen # because the right mouse button brings up the # Karamba menu. # 4,5 = Scroll wheel up and down def widgetClicked(widget, x, y, button): pass #This gets called everytime our widget is clicked. #Notes # widget = reference to our widget # x = x position (relative to our widget) # y = y position (relative to our widget) # botton = button being held: # 0 = No Mouse Button # 1 = Left Mouse Button # 2 = Middle Mouse Button # 3 = Right Mouse Button, but this will never happen # because the right mouse button brings up the # Karamba menu. def widgetMouseMoved(widget, x, y, button): #Warning: Don't do anything too intensive here #You don't want to run some complex piece of code everytime the mouse moves pass # This will be printed when the widget loads. print "Loaded my python extension!"