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?
win = GtkWindow("gtkwait")
state = ask_dialog("Like or Not?", "No", "Yes")
Try ensuring it runs in the UI thread by putting it in an
Gtk.@idle_add begin ... end block.
Also, I think the
Gtk.waitforsignal call is only intended for the end of a script?
I think you can ignore
@idle_add for now, it looks like, based on the documentation, you need to put the
ask_dialog first, 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.
Right, it may need people to look more deeply into what’s going on. I might be able to poke around but I’m not the most familiar with the code base.
Can you support please?
Oh no… this is a Heisenbug. If you stick
printlns in the function, it starts working
Sorry, I mean in the Gtk.jl function itself. But, you can call the internal functions directly and it seems to work:
dlg = GtkMessageDialog(message, ((no_text, 0), (yes_text, 1)),
Gtk.GtkDialogFlags.DESTROY_WITH_PARENT, Gtk.GtkMessageType.QUESTION, Gtk.GtkNullContainer())
println("I'm necessary for some reason")
response = run(dlg)
status = response == 1
Many thanks for your help. It works!
A better solution was posted in the GitHub issue you could try.
Thank you, I will have a look
for the records: Here is what you want if you are using Gtk in an interactive/still scripted manner:
t = @async begin
state = ask_dialog("Find Steady-state solution and start rom steady-state?", "No", "Yes")
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?
Meanwhile I found a thread that shows how to count the number of available monitors and select a monitor to display a window, this is already great.
Now it would be nice to figure out on which monitor my current
REPL-window is located,
has someone a suggestion?