Mousetrap, a GUI engine designed for Julia, just released version 0.3.0.
This version makes Mousetrap fully portable, meaning it will now run on any 64-bit desktop operating system - without caveats.
It furthermore added a new feature that allows any OpenGL-based library to render to a Mousetrap widget. This was used to implement a (still experimental) GLMakie interface, such that Makie plots can now be displayed inside a Mousetrap application, just like any other widget.
If you were unsure about Mousetrap.jl due to stability, portability, and missing Makie integration, v0.3.0 addressed these concerns and hopes to aid in long-term adoption.
If you are knowledgeable about Makie, consider participating in the development of MousetrapMakie.jl, a newly created package that strives to make Makie integration seamless and fully featured.
Thank you for your consideration,
C. Cords
PS: See here for how to install Mousetrap. We are still waiting on pull requests with Yggdrasil and the Julia registry being merged, meaning add Mousetrap does not yet work, though it will soon.
There are a few other tools that seem to have similar functionality and itās difficult for me to figure which one to use without investing a lot of time playing around with them all.
If I was to choose between Mousetrap and QML.jl (which looks similar) what are the pros and cons of each? Does QML.jl lack the Makie rendering capability?
Are there other Julia GUI engines that are similar to Mousetrap?
Iām reading through the documentation for touch events, and while there are some multitouch events like pinch-zoom, rotate, and swipe, I was wondering if this can support simultaneous independent touches, each a simple press>possible move>release; an example off the top of my head is how multiple fingers on some drawing apps like Paint can independently draw different things per touch. I had considered if mouse button events can be repurposed for this, but ātouchscreen ātapsā will be registered as if the left mouse button was pressedā seems to imply there can only be one such touch at a time.
Looks cool, Iām looking forward to giving it a try.
I too would like comments contrasting this to other packages. It may be that there are no other packages working on guisā¦but Iām pretty sure Iāve heard of several. I understand the polite desire to refrain from critiquing other packages, but the earlier that architecture differences are made known, the sooner their implications can be considered and resourced correctly.
This paragraph from this package docs is worth highlighting:
Heavy editorializing has taken place, renaming or completely removing certain parts of GTK4 in an effort to make mousetrap more friendly to newcomers and people with no GUI experience, easier to use, and less susceptible to developer error.
Note: February 8th, 2024: Iāve been having some health issues at the moment, it may take me some time to get to open issues. Mousetrap is still usable and (mostly) stable, the repo will be maintained in the immediate future to the best of my abilities. Thank you for your understanding, C.
The author of Mousetrap is currently commiting actively in their next project, which is in Lua. Mousetrap as well as jluna appear to be abandoned, and the author doesnāt respond to GitHub issues. It is really pity about the wasted effort: One is probably not going to build anything on such a foundation.
I could install in 1.11 on Linux but not run (seemingly can work, and on Windows, see below):
(pharaldsson) pkg> st
Status `~/Project.toml`
[ac6e5ff7] JuliaSyntaxHighlighting v0.1.0
[5deeb4b9] Mousetrap v0.3.3 `https://github.com/HyperSphereStudio/Mousetrap.jl#main`
[287f9a42] libmousetrap_jll v0.3.0+0 `https://github.com/Clemapfel/mousetrap_jll#main`
julia> using Mousetrap
Precompiling Mousetrap...
Info Given Mousetrap was explicitly requested, output will be shown live
ERROR: LoadError: InitError: could not load library "/home/pharaldsson/.julia/artifacts/b292ae2e313d5ab559c9838dfb8390f192b4f3b8/lib/libmousetrap_julia_binding.so"
libjulia.so.1: cannot open shared object file: No such file or directory
What might work for others is this fork, note different name with lib in front (but not for me since itās not build for Linux only Windows, should be fixable):
(pharaldsson) pkg> add https://github.com/HyperSphereStudio/libmousetrap_jll
Updating git-repo `https://github.com/HyperSphereStudio/libmousetrap_jll`
Resolving package versions...
Updating `~/Project.toml`
[287f9a42] ~ libmousetrap_jll v0.3.0+0 `https://github.com/Clemapfel/mousetrap_jll#main` ā v0.4.8+0 `https://github.com/HyperSphereStudio/libmousetrap_jll#main`
Updating `~/Manifest.toml`
[287f9a42] ~ libmousetrap_jll v0.3.0+0 `https://github.com/Clemapfel/mousetrap_jll#main` ā v0.4.8+0 `https://github.com/HyperSphereStudio/libmousetrap_jll#main`
Precompiling project...
ā Mousetrap
1 dependency successfully precompiled in 5 seconds. 177 already precompiled.
1 dependency errored.
For a report of the errors see `julia> err`. To retry use `pkg> precompile`
julia> err
PkgPrecompileError: The following 1 direct dependency failed to precompile:
Mousetrap
Failed to precompile Mousetrap [5deeb4b9-6e04-4da7-8b7f-c77fb1eae65e] to "/home/pharaldsson/.julia/compiled/v1.11/Mousetrap/jl_ckrovz".
ERROR: LoadError: UndefVarError: `mousetrap_julia_binding` not defined in `libmousetrap_jll`