go-qml / qml

QML support for the Go language
Other
1.96k stars 187 forks source link

fmt.Println() or console.log() output only printed upon closing program #118

Closed djahma closed 9 years ago

djahma commented 9 years ago

Just experimented with qml. Now moving to go-qml, my go "fmt.PrintLn()" statements and my QML "console.log()" statements are only printed once I close the program. From Go: package main

import ( "fmt" "gopkg.in/qml.v1" "time" )

func main() { fmt.Println("Before QML run") qml.Run(run) fmt.Println("After QML run") time.Sleep(1e9 * 2) }

func run() error { engine := qml.NewEngine() component, err := engine.LoadFile("qml/windock.qml") if err != nil { panic(err) } window := component.CreateWindow(nil) window.Show() window.Wait() return nil }

How to get these println statements show up as I run the program, live? My windock.qml file also contains typical console.log() statements in various places that show up properly when launched from QtCreator; but once launched from go, all these statements show up all at once after I close my program. This is causing experimentation/debugging extremely difficult... thanks for your help

djahma commented 9 years ago

ok, this is due to SublimeText2 console...sorry. From a classic shell, everything is fine