Closed qq1792569310 closed 4 months ago
One more question, right now after I run core run
, there are two windows, a hello
window created by main.go
and an Async Updating
window created by async.go
.
When I am in the Async Updating
window and click window>Quit
, the Async Updating
window gets stuck (not unresponsive) and cannot exit, the hello
window works fine still at this point, then I click on the close button (the x in the upper right corner) of the hello
window, and the hello
window gets stuck as well.
At this point there is no way to close the program through the window, I have to use the task manager to end the process.
The documentation for RunMainWindow
states that:
RunMainWindow creates a new main window from the body, runs it, starts the app's main loop, and waits for all windows to close. It should typically be called once by every app at the end of their main function. It can not be called more than once for one app. For more specific configuration and for secondary windows, see [Body.NewWindow].
You cannot call RunMainWindow
twice; instead, you should just call b.NewWindow().Run()
for secondary windows.
The documentation for
RunMainWindow
states that:RunMainWindow creates a new main window from the body, runs it, starts the app's main loop, and waits for all windows to close. It should typically be called once by every app at the end of their main function. It can not be called more than once for one app. For more specific configuration and for secondary windows, see [Body.NewWindow].
You cannot call
RunMainWindow
twice; instead, you should just callb.NewWindow().Run()
for secondary windows.
Hello teacher, aren't you sleeping at this time? I guess it's about three o'clock in the morning, right?
No, it is 11:25 PM. I am going to sleep now.
Okay
---Original--- From: @.> Date: Sat, Mar 2, 2024 15:26 PM To: @.>; Cc: @.**@.>; Subject: Re: [cogentcore/core] The program is not responding (Issue #924)
No, it is 11:25 PM. I am going to sleep now.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>
Describe the bug
When there is no waiting, execute two or more consecutive *gi. Body.RunMainWindow() function, there is a high probability that the program will not respond
How to reproduce
My file structure: async --async.go main.go
async.go
is from theasync.go
file of the example, andmain.go
is from the demo document.At the beginning of
main.go
, I executedasync.go
with a goroutine and it worked fine the first time, but when I startedcore run
a second time, the program didn't respondasync.go
:Just changed the package name and changed the function name 'main' to 'Async'main.go
: It's just that at the very beginning I used 'goroutine' to call 'async. Async()'The solution might be in the second gi.Body. RunMainWindow() before execution, wait a while?
async.go
: When I waited 5 seconds in async.go, the bug didn't appearExample code
No response
Relevant output
No response
Platform
Windows