raintean / blink Goto Github PK
View Code? Open in Web Editor NEW使用html来编写golang图形界面程序(only windows)
使用html来编写golang图形界面程序(only windows)
<input type="file" name="" id="file" value="" webkitdirectory directory />
还是选择的单个文件,通过查看 window.navigator ,是不是内核版本太低了。
如题,感谢!
很好的项目,注释也写得很有心。
打包资源文件
go-bindata.exe -o ui/ui.go -pkg ui html/...
blink.RegisterFileSystem("app", &assetfs.AssetFS{
Asset: ui.Asset,
AssetDir: ui.AssetDir,
AssetInfo: ui.AssetInfo,
})
view.LoadURL("http://app/index.html")
运行后是空白,不知道为什么。。。
提示这个错误build command-line-arguments: cannot find module for path github.com/CHH/eventemitter。但是已经安装这个包了
用chrome的浏览器测试get或者post 数据到后台API都没有问题。
但是用您这个GUI封装以后,发现post的数据头格式不对,我想应该可以在程序里面设置request header吧?例如content-type 或 access-control-request-headers之类的.
编译成exe后测试的,反复启动测试
如果用户名为中文, 那么common.TempPath变量中就会包含中文字符, 然后blink的init方法中加载dll的LoadLibraryW可能会出现错误, 目前只是有人反馈, 本人没有实测, 另外我没有花时间去研究win上的编码, 有这个方面经验的童鞋可能帮忙实测/解决一下这个问题.
如果没有弄错,Miniblink应该只有node.dll 32位版本的,
请问您是如何生成blink64.dll的呢?难道有64位的node.dll,还是自己编译的?
谢谢
增加托盘,增加菜单,增加无边框,完美
JS执行GO函数BlinkFunc.GetData(11) 怎么获取返回值啊?
在网页上调用
BlinkFunc.MostTop(flag)
或者调用透过view.inject注入的函数
然后点击网页触发函数,native function有大概率不会执行,10次里面大概只有4次成功。
我使用的是示例里边的 代码
为什么编译的时候提示.\main.go:21:14: undefined: bin
对下面的程序,运行,关闭,运行,关闭,重复多次以后,会crash。
var view *blink.WebView
func main() {
exit := make(chan bool)
//done := make(chan bool)
blink.SetDebugMode(false)
//初始化blink模块
err := blink.InitBlink()
if err != nil {
log.Fatal(err)
}
blink.RegisterFileSystem("app", &assetfs.AssetFS{
Asset: Asset,
AssetDir: AssetDir,
AssetInfo: AssetInfo,
})
//新建view,加载URL
view = blink.NewWebView(false, 1060, 800)
view.LoadURL("http://app/index.html")
//view.LoadURL("http://localhost:8080/")
view.MoveToCenter()
view.ShowWindow()
<-exit
}
以下是crash的信息
E:\gowork\src\gemini_scanner>gemini_scanner.exe
Exception 0xc0000005 0x1 0xc00006df48 0x76b698da
PC=0x76b698da
signal arrived during external code execution
syscall.Syscall(0x76b69910, 0x1, 0xc00006df38, 0x0, 0x0, 0x0, 0x0, 0x0)
E:/Go/src/runtime/syscall_windows.go:186 +0xea
github.com/lxn/win.DispatchMessage(...)
e:/gowork/src/github.com/lxn/win/user32.go:2000
github.com/raintean/blink.InitBlink.func2(0xc0001e8010, 0xf, 0x164d6de, 0x2)
e:/gowork/src/github.com/raintean/blink/blink.go:91 +0x2e8
created by github.com/raintean/blink.InitBlink
e:/gowork/src/github.com/raintean/blink/blink.go:55 +0x38c
goroutine 1 [chan receive, locked to thread]:
main.main()
e:/gowork/src/gemini_scanner/main.go:157 +0x2cc
goroutine 21 [chan send]:
github.com/raintean/blink.(*WebView).SetWindowTitle(0xc0001fc0a0, 0xc000022140, 0x45)
e:/gowork/src/github.com/raintean/blink/webview.go:158 +0xc3
github.com/raintean/blink.NewWebView.func4(0xc0001fc0a0, 0xc000022140, 0x45)
e:/gowork/src/github.com/raintean/blink/webview.go:83 +0x56
reflect.Value.call(0x15cd2e0, 0x16762e0, 0x13, 0x164da79, 0x4, 0xc0001d2030, 0x2, 0x2, 0x0, 0x0, ...)
E:/Go/src/reflect/value.go:447 +0x468
reflect.Value.Call(0x15cd2e0, 0x16762e0, 0x13, 0xc0001d2030, 0x2, 0x2, 0x0, 0x0, 0x0)
E:/Go/src/reflect/value.go:308 +0xab
github.com/CHH/eventemitter.(*EventEmitter).Emit.func1(0xc000004040, 0xc0000241e0, 0x1650220, 0xc, 0x15cd2e0, 0x16762e0, 0x13)
e:/gowork/src/github.com/CHH/eventemitter/eventemitter.go:81 +0x83
created by github.com/CHH/eventemitter.(*EventEmitter).Emit
e:/gowork/src/github.com/CHH/eventemitter/eventemitter.go:80 +0x25d
rax 0x0
rbx 0x0
rcx 0x22d0a70
rdi 0x7fffff9c000
rsi 0xc00006df38
rbp 0xc00006deb8
rsp 0x5c3fd50
r8 0x5c3fcf0
r9 0x0
r10 0x1b233199
r11 0x0
r12 0x2676fa0
r13 0x0
r14 0x1
r15 0x3e8
rip 0x76b698da
rflags 0x10246
cs 0x33
fs 0x53
gs 0x2b
用了ToTop或MostTop也没效果
您自己通过源码编译成blink.dll?是基于mb免费的?
如果想用收费的,应该怎么弄?
可以通过js的ready赋值
但这有延迟,不合适
另外想问下,exe的图片有没有好的办法修改。通过rice貌似win32系统不行
Hi, how to enable headless mode?
注册了BlinkFunc.GetConfig函数,但是有的时候运行程序起来之后,透过网页的js去调用这个函数,在devtool里会看到下面的提示:
unhandled promise rejection TypeError: BlinkFunc.GetConfig is not a function
重新运行程序又好了。但是不定时的会出来。
Hi, I am using the example in the project man page, but there is a problem, if you use
<-make(chan bool)
to let the program keep runing, then after you close the web window, the program won't exit.
How can I make the program exit entirely after I close the last window?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.