# Gtk open\_dialog

**URL:** https://discourse.julialang.org/t/gtk-open-dialog/5624
**Category:** General Usage
**Tags:** question
**Created:** [August 29, 2017, 6:08pm UTC](https://discourse.julialang.org/t/gtk-open-dialog/5624 "2017-08-29T18:08:13Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)
#### Post date: [August 29, 2017, 6:08pm UTC](https://discourse.julialang.org/t/gtk-open-dialog/5624/1 "2017-08-29T18:08:13Z")

</div>

Hi all!  
Does anyone else have a problem with `Gtk.open_dialog`?  
I’ve submitted an [issue](https://github.com/JuliaGraphics/Gtk.jl/issues/297), but wanted to reach out to other people that have used this function and hear what their experience is like.  
Here’s the gist of my issue:

> Out of the following three only number #1 works:
> 
> 1. `julia> open_dialog("Pick a file")`
> 2. `julia> include("a_file_with_open_dialog_in_it.jl")`
> 3. `$ julia a_file_with_open_dialog_in_it.jl`
> 
> Pressing `Cancel` or `Open` in the other two scenarios doesn’t do anything, the dialog window is just stuck.

---

<div class="post-metadata">

### Author: ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)
#### Post date: [August 30, 2017, 7:42am UTC](https://discourse.julialang.org/t/gtk-open-dialog/5624/2 "2017-08-30T07:42:09Z")

</div>

It works fine on OS X for me. Maybe try to add some prints in the function to see at which point it gets stuck (probably in `run`).

---

<div class="post-metadata">

### Author: ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)
#### Post date: [August 30, 2017, 8:16am UTC](https://discourse.julialang.org/t/gtk-open-dialog/5624/3 "2017-08-30T08:16:34Z")

</div>

Right you are, @jonathanBieler. [Line #82](https://github.com/JuliaGraphics/Gtk.jl/blob/d39896726bedac6415b1c05764b336f92508b294/src/selectors.jl#L82) gets stuck.

Curiously, adding a `println("something")` before that line “fixes the problem” and everything works fine. Does that tell you anything about what’s going on?

---

<div class="post-metadata">

### Author: ![jonathanBieler](https://avatars.discourse-cdn.com/v4/letter/j/82dd89/32.png) [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)
#### Post date: [August 30, 2017, 8:57am UTC](https://discourse.julialang.org/t/gtk-open-dialog/5624/4 "2017-08-30T08:57:33Z")

</div>

Gtk is somehow linked to Julia’s task [system](https://github.com/JuliaGraphics/Gtk.jl/blob/6298bd465922289ab3f3586143b47e58eedd44c7/src/GLib/signals.jl#L149) so it might have something to do with it. At some point I had a a similar issue on Windows (I just gave up windows support). What happens if you put `yield()` instead of `print` ?

This might be the same issue (`g_sigatom` gets called way more than on OS X):

[https://github.com/JuliaGraphics/Gtk.jl/issues/181](https://github.com/JuliaGraphics/Gtk.jl/issues/181)

---

<div class="post-metadata">

### Author: ![yakir12](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yakir12/32/297_2.png) [@yakir12](https://discourse.julialang.org/u/yakir12)
#### Post date: [August 30, 2017, 9:07am UTC](https://discourse.julialang.org/t/gtk-open-dialog/5624/5 "2017-08-30T09:07:56Z")

</div>

Putting `yield()` before line 82 works! I’ll add my report of this behavior to that issue. Thanks a ton for the help!
