Ejemplo n.º 1
0
def main():
    clsname = sapi.SciterClassName()
    sciter.runtime_features(allow_sysinfo=True)

    title = u"Win32 Sciter"
    clsname = u"PySciter"

    WndProc = WNDPROCTYPE(on_wnd_message)
    wndClass = WNDCLASSEX()
    wndClass.cbSize = sizeof(WNDCLASSEX)
    wndClass.style = CS_HREDRAW | CS_VREDRAW
    wndClass.lpfnWndProc = WndProc
    wndClass.cbClsExtra = 0
    wndClass.cbWndExtra = 0
    wndClass.hInstance = windll.kernel32.GetModuleHandleW(0)
    wndClass.hIcon = 0
    wndClass.hCursor = windll.user32.LoadCursorW(0, IDC_ARROW)
    wndClass.hBrush = windll.gdi32.GetStockObject(WHITE_BRUSH)
    wndClass.lpszMenuName = 0
    wndClass.lpszClassName = clsname
    wndClass.hIconSm = 0

    if not windll.user32.RegisterClassExW(byref(wndClass)):
        err = windll.kernel32.GetLastError()
        print('Failed to register window: ', err)
        exit(0)

    hWnd = windll.user32.CreateWindowExW(0, clsname, title,
                                         WS_OVERLAPPEDWINDOW, CW_USEDEFAULT,
                                         CW_USEDEFAULT, 800, 600, 0, 0, 0, 0)
    if not hWnd:
        err = windll.kernel32.GetLastError()
        print('Failed to create window: ', err)
        exit(0)

    scproc = SciterHostCallback(on_sciter_callback)
    sapi.SciterSetCallback(hWnd, scproc, None)

    url = u"examples/minimal.htm"
    sapi.SciterLoadFile(hWnd, url)

    windll.user32.ShowWindow(hWnd, SW_SHOW)
    windll.user32.UpdateWindow(hWnd)

    msg = MSG()
    lpmsg = pointer(msg)

    print('Entering message loop')
    while windll.user32.GetMessageW(lpmsg, 0, 0, 0) != 0:
        windll.user32.TranslateMessage(lpmsg)
        windll.user32.DispatchMessageW(lpmsg)

    print('Quit.')
Ejemplo n.º 2
0
"""Minimalistic PySciter sample for Windows."""

import sciter

if __name__ == '__main__':
    sciter.runtime_features(allow_sysinfo=True)

    frame = sciter.Window(ismain=True, uni_theme=True)
    frame.load_file("examples/minimal.htm")
    frame.run_app()
Ejemplo n.º 3
0
"""Minimalistic PySciter sample for Windows."""

import sciter

if __name__ == '__main__':
    sciter.runtime_features(file_io=True, allow_sysinfo=True)

    frame = sciter.Window(ismain=True, uni_theme=True)
    frame.load_file("examples/minimal.htm")
    frame.run_app()