-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Wierd bug with a nested checkbox #32
Comments
I think I've seen something similar with a much more complicated example (one so complicated I made almost no headway debugging it). In my case it seemed to fall into a cycle and kept trying to create new windows. For reference (and because I'm in the middle of something else and don't have time to pursue it further), the following is a workaround: using GtkReactive, Gtk.ShortNames
w = Window("a")
a = button("a")
b = Box(:h)
push!(b, a)
function create_checkbox()
global cb
global b
cb = checkbox(rand(Bool))
push!(b, cb)
end
updater = map(signal(a); init=nothing) do _
@schedule println("clicked")
@schedule create_checkbox()
nothing
end
push!(w, b)
showall(w) This adds a new checkbox each time you click the button. (You have to It might be worth pinging @JobJob and @shashi about this, since this could be a Reactive issue. |
Thanks for the workaround! |
The equivalent code in Interact is also broken:
that was an issue in Reactive. I've fixed that in |
Ok I've fixed the issue in the OP on that branch now, but I'm not 100% happy with the solution, will see if I can improve it tomorrow. Let me know how you go with it. |
Oh note, I also needed to add another
|
@JobJob's solution fixed both the example above and my actual code (I had to |
Thanks for the minimal reproduction @yakir12 - I'd been running into this issue the last few days, but wasn't sure exactly what was up - this helped a lot! |
Spoke too soon. I'll hopefully be back with an example. |
I wrote a simplified version of my code. But I can't reproduce the same faulty behavior I have in my real code in this simplified version. I'll try to strip off all the layers of complexity from my real code and see what causes the problem. I'll be back... |
So I take it from #33 Reactive can breathe easy, this is resolved with the fix above? |
That is correct. |
Why does this (albeit contrived) example not work?
Running this builds the checkbox and prints the boolean, but then it dies (pressing on the button doesn't produce any additional checkboxes nor prints the booleans). Rerunning this within the same session halts the Julia session and I need to pkill julia or Ctrl-Z.
I'm on Version 0.6.0-dev.1393 (2016-12-09 01:03 UTC)
The text was updated successfully, but these errors were encountered: