Sign in

    webui

    🚀 moon 绑 定 webui 库。

    webui
    gui
    browser
    Download zip
    Author
    Version
    0.0.4
    License
    MIT
    Last updated
    last year
    Downloads
    196

    #KingBes/webui

    使用任何 Web 浏览器 GUI,前端使用现代 Web 技术,一个轻量级的可移植库。

    #为什么要使用 Web 浏览器?

    今天的 Web 浏览器拥有现代 UI 所需的一切。Web 浏览器非常复杂和优化。因此,将其用作 GUI 将是一个很好的选择。虽然旧的旧版 GUI 库复杂且过时,但基于 WebView 的应用程序仍然是一种选择。但是,WebView 需要一个巨大的 SDK 来构建和许多依赖项来运行,并且它只能提供一些功能,例如真正的 Web 浏览器。这就是为什么 WebUI 使用真正的 Web 浏览器为您提供全面 Web 技术的全部功能,同时保持您的软件轻量级和可移植性。

    #入口配置moon.pkg.json

    windows-x64环境

    { "is-main": true, "link":{ "native": { "cc": "gcc", "cc-flags": "-lwebui -lws2_32 -Wall -luser32 -static -lole32 -mwindows", "cc-link-flags": "-Os -Wl,-subsystem=windows -L.mooncakes/KingBes/webui/lib/windows" } } }

    linux-x64环境

    { "is-main": true, "link":{ "native": { "cc": "gcc", "cc-flags": "-lwebui -lpthread -lm -ldl", "cc-link-flags": "-L.mooncakes/KingBes/webui/lib/linux" } } }

    #运行

    moon run --target native xxx

    #示例

    fn main { let window:Int64 = @webui.new_window() @webui.set_size(window, 800, 600) let html = "<html><script src=\"webui.js\"></script> Hello World from Moon! </html>" let show:Bool = @webui.show(window,html); if show { @webui.wait(); } }

    c_str

    fn c_str(s : String) -> Bytes
    字符串转C字符串