Julia is freezing when I use ask_dialog() in julia file. I added extra code as suggested to let it work, however, the problem is still existing. Any solution?
using Gtk
win = GtkWindow("gtkwait")
if !isinteractive()
@async Gtk.gtk_main()
Gtk.waitforsignal(win,:destroy)
end
state = ask_dialog("Like or Not?", "No", "Yes")
I think you can ignore @idle_add for now, it looks like, based on the documentation, you need to put the ask_dialogfirst, and then at the end of the script, do the if !isinteractive block.
Ah, I see the issue. Sorry, just trying it out myself.
It’s not that it gets frozen per se, it’s that the dialog button press isn’t registering somehow, so the dialog never closes and allows the program to continue.
for the records: Here is what you want if you are using Gtk in an interactive/still scripted manner:
using Gtk
if !isinteractive()
@async Gtk.gtk_main()
end
t = @async begin
state = ask_dialog("Find Steady-state solution and start rom steady-state?", "No", "Yes")
end
if !isinteractive()
wait(t)
end
Another issue is the problem that occurs when you work with multiple monitors.
Is it possible that the pop-up window opens on the same monitor, where the REPL is located?