Exemplo n.º 1
0
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;
    """)
Exemplo n.º 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);
Exemplo n.º 3
0
def getClientWidth():
    width = wnd().props.inner_width
    if width:
        return width
    return doc().props.body.props.client_width;
Exemplo n.º 4
0
def getClientHeight():
    height = wnd().props.inner_height
    if height:
        return height
    return doc().props.body.props.client_height;
Exemplo n.º 5
0
def resize(width, height):
    print "resize", width, height
    wnd().resize_to(width, height)
    wnd().resize_by(width, height)
Exemplo n.º 6
0
def alert(msg):
    wnd().alert(msg)