function caller() {
someLibrary.getMeSomething(arg1, arg2, function(returnedData) {
// this is the callback which will do something with returnedData
});
}
class MyUIClass:
def __init__(self):
someUILib.register(someUILib.events.MOUSE_CLICK, self.my_mouse_click_handler);
def my_mouse_click_handler(self, eventInfo):
# do something with event
if eventInfo.x < 100:
print 'You clicked in the margin'