def getLocation():
    global location
    if not location:
        print dir(wnd())
        location = Location.Location(wnd().props.location)
    return location
    JS("""
    if(!Window_location)
       Window_location = Location_Location($wnd.location);
    return Window_location;
    """)
Exemple #2
0
def _dispatchCapturedMouseoutEvent(evt):
    cap = getCaptureElement()
    if cap:
        print "cap", dir(evt), cap
        if not eventGetToElement(evt):
            print "synthesise", cap
            #When the mouse leaves the window during capture, release capture
            #and synthesize an 'onlosecapture' event.
            setCapture(None)
            if cap._listener:
                # this should be interesting...
                lcEvent = doc().create_event('UIEvent')
                lcEvent.init_ui_event('losecapture', False, False, wnd(), 0)
                dispatchEvent(lcEvent, cap, cap._listener);
def getClientWidth():
    width = wnd().props.inner_width
    if width:
        return width
    return doc().props.body.props.client_width;
def getClientHeight():
    height = wnd().props.inner_height
    if height:
        return height
    return doc().props.body.props.client_height;
def resize(width, height):
    print "resize", width, height
    wnd().resize_to(width, height)
    wnd().resize_by(width, height)
def alert(msg):
    wnd().alert(msg)