better support for different versions of gtk by bjarthur · Pull Request #242 · JuliaGraphics/Gtk.jl (original) (raw)

@timholy {open,save}_dialog / GtkFileChooserDialog is broken. it has been so for awhile i believe, and only came to light when i refactored the tests to use @testset. i'm at a loss as to how to fix it. could you please take a look?

the error returned is a MethodError:

julia> using Gtk.ShortNames, Gtk.GConstants

julia> @FileChooserDialog("Select file", @Null(), GtkFileChooserAction.OPEN,
                                   (("_Cancel", GtkResponseType.CANCEL),
                                    ("_Open", GtkResponseType.ACCEPT)))
ERROR: MethodError(Gtk.GtkFileChooserDialogLeaf,("Select file",Gtk.GtkNullContainer(<NULL>),0,(("_Cancel",-6),("_Open",-3))))
 in #GtkFileChooserDialogLeaf#90(::Array{Any,1}, ::Type{T}, ::String, ::Vararg{Any,N}) at /home/arthurb/.julia/v0.5/Gtk/src/GLib/gtype.jl:212
 in Gtk.GtkFileChooserDialogLeaf(::String, ::Gtk.GtkNullContainer, ::Int32, ::Tuple{Tuple{String,Int32},Tuple{String,Int32}}) at /home/arthurb/.julia/v0.5/Gtk/src/GLib/gtype.jl:211

@Matt5sean3 's solution to wrap strings in Gtk.String didn't work.

thanks.