FAQ

On Sun, May 1, 2016 at 5:41 PM, Daniel Skinner wrote:
Looks like go routines started within gldriver.Main never get scheduled to
run.
Huh. I don't see this. With this patch:

$ git diff
diff --git a/shiny/example/fluid/main.go b/shiny/example/fluid/main.go
index 842a9cd..d45ad95 100644
--- a/shiny/example/fluid/main.go
+++ b/shiny/example/fluid/main.go
@@ -22,7 +22,7 @@ import (
         "sync"
         "time"

- "golang.org/x/exp/shiny/driver"
+ driver "golang.org/x/exp/shiny/driver/gldriver"
         "golang.org/x/exp/shiny/screen"
         "golang.org/x/mobile/event/lifecycle"
         "golang.org/x/mobile/event/mouse"
@@ -48,6 +48,7 @@ const (

  func main() {
         driver.Main(func(s screen.Screen) {
+ go println("goroutine started from within driver.Main!")
                 w, err := s.NewWindow(nil)
                 if err != nil {
                         log.Fatal(err)

the example/fluid program does print, on both Darwin and Linux.

What's your GOOS?

As for why example/fluid doesn't work on Linux gldriver, I suspect
that it's because gldriver/x11.go is not sending lifecycle events.

To confirm, edited fluid example to move simulation outside of
gldriver.Main, globalize event queue, continue on nil eventqueue (until
gldriver.Main made window), and example was running.
Can you copy/paste a "git diff" of what your changes are? It's hard to
tell exactly just from a description instead of code.

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 7 of 10 | next ›
Discussion Overview
groupgolang-nuts @
categoriesgo
postedApr 29, '16 at 2:24p
activeMay 12, '16 at 3:25p
posts10
users4
websitegolang.org

People

Translate

site design / logo © 2021 Grokbase