How to use a Button in GLMakie

The following code fails:

using GLMakie, AbstractPlotting, AbstractPlotting.MakieLayout

scene, layout = layoutscene(resolution = (840, 900))
Button(scene, label = "RESET")

with the following error:

julia> include("src/Minimal2.jl")
ERROR: LoadError: MethodError: no method matching (Button{ArgType} where ArgType)(::Scene; label="RESET")
Closest candidates are:
  (::Type{var"#s199"} where var"#s199"<:AbstractPlot{Typ})(::SceneLike, ::Attributes, ::Any) where Typ at /home/ufechner/.julia/packages/AbstractPlotting/JCbJs/src/interfaces.jl:418 got unsupported keyword argument "label"
  (::Type{var"#s199"} where var"#s199"<:AbstractPlot{Typ})(::SceneLike, ::Attributes, ::Any, ::Any) where Typ at /home/ufechner/.julia/packages/AbstractPlotting/JCbJs/src/interfaces.jl:439 got unsupported keyword argument "label"
  (::Type{var"#s199"} where var"#s199"<:Combined)(::Any, ::Any, ::Any, ::Any, ::Any) at /home/ufechner/.julia/packages/AbstractPlotting/JCbJs/src/interfaces.jl:357 got unsupported keyword argument "label"
Stacktrace:
 [1] top-level scope
   @ ~/repos/KiteViewer/src/Minimal2.jl:4
 [2] include(fname::String)
   @ Base.MainInclude ./client.jl:444
 [3] top-level scope
   @ REPL[1]:1
in expression starting at /home/ufechner/repos/KiteViewer/src/Minimal2.jl:4

What am I doing wrong?

The code above works with these package versions:

(KiteViewer) pkg> status
Status `~/repos/KiteViewer/Project.toml`
  [537997a7] AbstractPlotting v0.15.9
  [e9467ef8] GLMakie v0.1.25
  [5c1252a2] GeometryBasics v0.3.5
  [ee78f7c6] Makie v0.12.0
  [7269a6da] MeshIO v0.4.3

It fails with these package versions:

(KiteViewer) pkg> status
Status `~/repos/KiteViewer/Project.toml`
  [537997a7] AbstractPlotting v0.12.18
  [e9467ef8] GLMakie v0.1.13
  [5c1252a2] GeometryBasics v0.3.9
  [ee78f7c6] Makie v0.11.1
  [dbd62bd0] MakieGallery v0.2.17
  [7269a6da] MeshIO v0.4.3

So the problem was that I installed MakieGallery which resulted in downgrading Makie and other packages which made my code fail…

A pity that MakieGallery is not compatible with the newest version of Makie…

1 Like

MakieGallery contains a lot of outdated examples that were more like tests than gallery material. So they did not really serve the gallery purpose that well anyway. The examples now live in the docs, which is controlled by CI. And the tests live in AbstractPlotting, not a separate package.

if you tag your questions with Makie, we’re more likely to see them