Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

Julia Crash on GTK combo #672

Closed
rossati opened this issue Oct 22, 2022 · 2 comments
Closed

Julia Crash on GTK combo #672

rossati opened this issue Oct 22, 2022 · 2 comments

Comments

@rossati
Copy link

rossati commented Oct 22, 2022

Hi
This issue is about a crash on Julia.
the attached file contains:

  • crash.txt
  • quotes.txt
  • sandbox.jl
  • formgen.jl

versioninfo()

Julia Version 1.8.1
Commit afb6c60d69 (2022-09-06 15:09 UTC)
Platform Info:
OS: Windows (x86_64-w64-mingw32)
CPU: 4 × 11th Gen Intel(R) Core(TM) i3-1115G4 @ 3.00GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-13.0.1 (ORCJIT, tigerlake)
Threads: 1 on 4 virtual cores

Minimum reproducible example

Julia> include("sandbox.jl")
This creates a form.

  • Choose from the menu Examples Events.
  • It appears a second form, choose an Author, for example Alan Perlis.
  • The crash appens when the Reset button is clicked.

The statement in the 229 line of formgen.jl generates the crash:
set_gtk_property!(wdgHandles[key],:active,indx)

Best regards
Giovanni Rossati
scripts.zip

@tknopp
Copy link
Collaborator

tknopp commented Oct 22, 2022

The issue is that change the UI from within a callback, wich is not allowed. You need call it this way:

@idle_add set_gtk_property!(wdgHandles[key],:active,indx)

But actually you can/should do this much higher in the call stack. For instance

id = signal_connect(reset, "button-press-event") do widget, event
       @idle_add setValues()
end

It's important to note that the code after the @idle_add will be postponed and executed after the callback has finished. This may lead to differences.

@rossati
Copy link
Author

rossati commented Oct 22, 2022

Thanks

@tknopp tknopp closed this as completed Oct 23, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants