Closed Hyppothalamus closed 2 years ago
To open from Go or from the script?
at the moment i am trying to open it from the script. but if i can also open it in go, I am also happy
what I have atm: html
<html>
<style>
</style>
<script>
</script>
<body>
<h1>installer</h1>
<button id="selectFolder">Click Me</button>
<script type="text/tiscript">
$(button#selectFolder).onClick = function(){
var d = view.selectFolder("/home/kasper", "/home/kasper");
view.msgbox(d);
}
</script>
</body>
</html>
go
package main
import (
"github.com/sciter-sdk/go-sciter"
"github.com/sciter-sdk/go-sciter/window"
)
func main() {
// make rect for window
rect := sciter.NewRect(100, 100, 300, 500)
// create a window using upper rect
sciter.SetOption(sciter.SCITER_SET_SCRIPT_RUNTIME_FEATURES, sciter.ALLOW_SOCKET_IO)
sciter.SetOption(sciter.ALLOW_FILE_IO, 1)
sciter.SetOption(sciter.ALLOW_SYSINFO, 1)
win, _ := window.New(sciter.SW_TITLEBAR|sciter.SW_MAIN|sciter.SW_CONTROLS|sciter.SW_ENABLE_DEBUG, rect)
win.LoadFile("./main.html")
win.SetTitle("Kloterij")
win.Show()
win.Run()
}
if this can help also on arch linux x86
No, it's possible only from script.
JS: https://github.com/c-smile/sciter-js-sdk/blob/main/docs/md/Window.md#windowselectfileparams TIS: https://github.com/c-smile/sciter-sdk/blob/master/doc/content/sciter/View.htm#L121
at the moment i am trying to open it from the script. but if i can also open it in go, I am also happy
sciter.SetOption(sciter.SCITER_SET_SCRIPT_RUNTIME_FEATURES, sciter.ALLOW_SOCKET_IO) sciter.SetOption(sciter.ALLOW_FILE_IO, 1) sciter.SetOption(sciter.ALLOW_SYSINFO, 1)
This should be
sciter.SetOption(sciter.SCITER_SET_SCRIPT_RUNTIME_FEATURES, sciter.ALLOW_SYSINFO|sciter.ALLOW_FILE_IO)
thank you very much! it worked!
Like the title is saying is there a way to open a file dialog?
i have found some examples but can't figure out how to use them. any help is always welcome. :)