def set_main_frame(frame): global main_frame main_frame = frame from pyjamas import DOM # ok - now the main frame has been set we can initialise the # signal handlers etc. DOM.init()