Closed ma-seefelder closed 1 year ago
I can reproduce this on windows only
The following causes the same behavior on my machine, it would be nice if you can confirm this, though I'm pretty sure it will have the same behavior on yours too:
using GTK4_jll
@ccall GTK4_jll.libgtk4.gtk_init()::Cvoid
dialog = @ccall GTK4_jll.libgtk4.gtk_file_dialog_new()::Ptr{Cvoid}
@ccall GTK4_jll.libgtk4.gtk_file_dialog_select_folder(dialog::Ptr{Cvoid}, C_NULL::Ptr{Cvoid}, C_NULL::Ptr{Cvoid}, C_NULL::Ptr{Cvoid}, C_NULL::Ptr{Cvoid})::Cvoid
You may need to install GTK4_jll
using import Pkg; Pkg.add("GTK4_jll")
This means this is not a bug with mousetrap, but most likely with the Julia BinaryBuilder jlls, which aren't maintained by me. I will open an issue with the relevant people and report back, this is a pretty huge bug but sadly this isn't only up to me, so the time frame is also out of my control.
I'm getting
(process:5976): GLib-GIO-ERROR **: 17:50:09.776: No GSettings schemas are installed on the system
For the GTK4-only MWE, which makes me think this is related to #5
Thanks for your answer. I can confirm that executing the GTK4_jll code on my Windows machine also leads to a long error message and an immediate crash of my Julia session. So it seems not to be a bug with mousetrap.
Thank you, I will try to find a workaround to the best of my abilities, as this is a pretty serious bug.
You're welcome. Thanks for your work and effort. Mousetrap.jl is really nice for creating GUIs and the documentation is easily understandable. For my purposes, I will simply generate a text field with Entry() in which the folder path should be copied.
I had similar issues when running something like
file_saver = FileChooser(FILE_CHOOSER_ACTION_SAVE, "Save")
present!(file_saver)
@ma-seefelder You may want to look into https://github.com/JuliaGraphics/NativeFileDialog.jl.
Hi, please add the following before the first using Mousetrap
, where you may need to install GTK4_jll
with import Pkg; Pkg.add("GTK4_jll")
:
import GTK4_jll; ENV["GSETTINGS_SCHEMA_DIR"] = normpath(joinpath(GTK4_jll.libgtk4, "../../share/glib-2.0/schemas"))
Does the FileChooser
still crash? A full main.jl
to check would be:
import GTK4_jll
ENV["GSETTINGS_SCHEMA_DIR"] = normpath(joinpath(GTK4_jll.libgtk4, "../../share/glib-2.0/schemas"))
using Mousetrap
main() do app
chooser = FileChooser(FILE_CHOOSER_ACTION_SELECT_FOLDER)
present!(chooser)
end
No, that seems to solve the issue. It also solves the problem when using the FILE_CHOOSER_ACTION_SAVE
action.
Okay nice, see https://github.com/Clemapfel/Mousetrap.jl/issues/5#issuecomment-1805945534 for how to make that fix permanent. The fix will be part of v0.3.1, I'll keep this issue open until then
I'm relatively new to GUI programming, and I'm encountering what might be an issue of my own code, or it could be a bug. I'm working on an application where I need to implement a FileChooser that enables users to select a folder. Currently, I'm using Julia 1.9.1 and Mousetrap.jl version 0.3.0. To create the FileChooser, I'm using the following code snippet:
When I try to execute this function either in the Julia REPL or from the command line, I get a really long error message (see below). When I use the FileChooser to select an individual, file I don't get any error messages and all works well: