沙滩星空的博客沙滩星空的博客

Go语言文件选择器与GUI框架介绍:Wails vs Fyne vs Webview

文件(文件夹)选择器

github.com/sqweek/dialog:

一个简易好用的跨平台的系统 对话框 API调用,可用于 选择文件(文件夹),消息提示,操作确认等。

# 消息确认对话框
ok := dialog.Message("%s", "Do you want to continue?").Title("Are you sure?").YesNo()

# 文件选择对话框
filename, err := dialog.File().Filter("Mp3 audio file", "mp3").Load()

# 保存文件对话框
directory, err := dialog.Directory().Title("Load images").Browse()
package main

import (
    "fmt"
    sqdialog "github.com/sqweek/dialog"
)

func main() {
    filename, err := sqdialog.File().Filter("Excel表格(*.xlsx)", "xlsx").Load()
    if err != nil {
        panic(err)
    }
    fmt.Println(filename)
}

Wails

C/S模式,一个后端服务,一个前端页面作为UI。前端可以使用 Vue / React / Angular。

Fyne

非 C/S 模式,UI都是由 Golang 写出来的。

注意: Fyne 编译出来的程序在 Windows Server 上跑不起来,因为显卡驱动永远是 OpenGL 1.1 且无法升级,而 Fyne 需要 > OpenGL 2.0

Webview

基于系统浏览器


Golang GUI开发之Webview https://esc.show/article/Golang-GUI-kai-fa-zhi-Webview
Golang 跨平台轻量GUI界面对比:Wails vs Fyne vs Webview https://zhuanlan.zhihu.com/p/404062419

未经允许不得转载:沙滩星空的博客 » Go语言文件选择器与GUI框架介绍:Wails vs Fyne vs Webview

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址