You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the program is not responding, if you accidentally click on the GUI during the process, it will run again after running. Is there any way to avoid this phenomenon.
GLmakie is very powerful. I sometimes use it to design GUI directly, but there are small problems during the process. For example, the following program is designed. When the click program is short (run 1s), the response is very fast. But when the program takes a long time (run 10s), the interface will remain unresponsive. During this period, if the mouse is accidentally clicked, there will be no response. The GUI will automatically run the next program after the program is finished running. The program itself takes a long time. I want to pause it as if the program is running on other threads. Ctrl+C has no effect. Is there any way to avoid this phenomenon?
I thought of three ideas
1. For unresponsive programs, if you click on the interface during this process, it will click to a other position by default. This will avoid the bug that the program identifies as clicking the same again.
2. Design an additional judgment condition for the button function. Only by pressing and releasing the mouse for a short time can the program be executed.
3. There are ways to pause and terminate programs running through the GUI. For example Ctrl+C.
The program code is
f = GLMakie.Figure()
btrun =Button(f[1,1],label="run 1s",tellwidth=false)
on(btrun.clicks) do s
println("1button clicks: ",s)
sleep(1)
end
btrun2 =Button(f[1,2],label="run 10s",tellwidth=false)
on(btrun2.clicks) do s
println("10button clicks: ",s)
sleep(10)
end
f
When the interface of the program becomes unresponsive, it remains stuck on this interface.
The output is, clicks 2 3 is the result of automatic operation
f = GLMakie.Figure()
btrun =Button(f[1,1],label="run 1s",tellwidth=false)
Makie.on_latest(btrun.clicks) do s
println("1button clicks: ",s)
sleep(1)
end
btrun2 =Button(f[1,2],label="run 10s",tellwidth=false)
Makie.on_latest(btrun2.clicks) do s
println("10button clicks: ",s)
sleep(10)
endscatter(f[2, :], 1:4)
f
This is indeed very useful. Thank you very much. There is another problem. Programs run using the GUI cannot be paused through Ctrl+C. Programs run through the direct repl command can be paused.
Normal code runs
for i=1:10println("run progrem: ",i)
sleep(1)
end
julia>run progrem:1
run progrem:2^C
ERROR: InterruptException:
GUI program:
f = GLMakie.Figure()
btrun =Button(f[1,1],label="run 10s",tellwidth=false)
Makie.on_latest(btrun.clicks) do s
for i=1:10println("button run progrem: ",i)
sleep(1)
endend
f
Press Ctrl + C after clicking the button:
button run progrem:1
button run progrem:2
button run progrem:3
julia>^C
julia> button run progrem:4
button run progrem:5
button run progrem:6
button run progrem:7
button run progrem:8
button run progrem:9
button run progrem:10
When the program is not responding, if you accidentally click on the GUI during the process, it will run again after running. Is there any way to avoid this phenomenon.
GLmakie is very powerful. I sometimes use it to design GUI directly, but there are small problems during the process. For example, the following program is designed. When the click program is short (run 1s), the response is very fast. But when the program takes a long time (run 10s), the interface will remain unresponsive. During this period, if the mouse is accidentally clicked, there will be no response. The GUI will automatically run the next program after the program is finished running. The program itself takes a long time. I want to pause it as if the program is running on other threads. Ctrl+C has no effect. Is there any way to avoid this phenomenon?
I thought of three ideas
1. For unresponsive programs, if you click on the interface during this process, it will click to a other position by default. This will avoid the bug that the program identifies as clicking the same again.
2. Design an additional judgment condition for the button function. Only by pressing and releasing the mouse for a short time can the program be executed.
3. There are ways to pause and terminate programs running through the GUI. For example Ctrl+C.
The program code is
When the interface of the program becomes unresponsive, it remains stuck on this interface.
The output is, clicks 2 3 is the result of automatic operation
The text was updated successfully, but these errors were encountered: