go-sciter icon indicating copy to clipboard operation
go-sciter copied to clipboard

stdout.println() doesn't work

Open WinXaito opened this issue 5 years ago • 2 comments

Hello,

I'm coming to you because I can't display logs in the console, stdout.println("..."); doesn't work in Tiscript.

I added "ALLOW_SYSINFO", "SW_ENABLE_DEBUG", but it still doesn't work.

Try it with:

  • Golang 1.13.4 & 1.14.7
  • Sciter version: 0x40004 3001d

Here's a simple example that doesn't work:

main.go

package main

import (
	"fmt"
	"github.com/sciter-sdk/go-sciter"
	"github.com/sciter-sdk/go-sciter/window"
	"path/filepath"
)

func main() {
	sciter.SetOption(sciter.SCITER_SET_SCRIPT_RUNTIME_FEATURES, sciter.ALLOW_SYSINFO|sciter.ALLOW_EVAL|sciter.ALLOW_FILE_IO|sciter.ALLOW_SOCKET_IO)

	w, err := window.New(sciter.SW_TITLEBAR|sciter.SW_RESIZEABLE|sciter.SW_CONTROLS|sciter.SW_MAIN|sciter.SW_ENABLE_DEBUG, nil)
	if err != nil {
		fmt.Println(err)
	}

	ok := w.SetOption(sciter.SCITER_SET_DEBUG_MODE, 1)
	if !ok {
		fmt.Println(err)
	}

	fullpath, err := filepath.Abs("./gui/simple.htm")
	if err != nil {
		fmt.Println(err)
	}

	err = w.LoadFile(fullpath)
	if err != nil {
		fmt.Println(err)
	}

	w.Show()
	w.Run()
}

simple.htm

<html>
    <head>
        <meta charset="UTF-8">
        <title>Test</title>
        <script rel="text/tiscript">
            stdout.println("This text doesn't appear in console");
        </script>
    </head>
    <body>
        <h1>Test</h1>
    </body>
</html>

When I run the program with Goland, I've got nothing in the output:

image

Same with terminal:

image

WinXaito avatar Aug 07 '20 14:08 WinXaito

SciterSetupDebugOutput is supposed to print the output. I'll check it.

pravic avatar Aug 07 '20 15:08 pravic

Any updates on this? This is also happening on Sciter.JS on Windows 10.

bloeys avatar May 31 '21 02:05 bloeys