Thanks for the help getting this far.
The setting and reading of the textbox value now works fine, sometimes.
Now I have a very strange error I’m not sure how to address. I have reproduced the error below in a simple demonstration.
To reproduce…
1.If I run the lines down to the comment
2. edit either textbox and press enter or not press enter
3. run the last two lines
4. I consistently get an error
I’m using vscode, Windows, julia v1.9.1, GLMakie v0.8.6
using GLMakie
fig = Figure(resolution=(500, 500));display(fig)
guiTextboxGrid = fig[1,1]= GridLayout(default_colgap=0,rowgap=1,padding=(0.0,0.0,0.0,0.0))
global textboxes = Vector{Any}(undef,12)
textboxes[1] = Textbox(guiTextboxGrid[1,1], reset_on_defocus=true,placeholder = "f1", height=40,width=200,fontsize=22)
textboxes[2] = Textbox(guiTextboxGrid[2,1], reset_on_defocus=true,placeholder = "f2", height=40,width=200,fontsize=22)
Makie.set!(textboxes[1],"a string1")
Makie.set!(textboxes[2],"another string1")
#set focus on either textbox and add a char
Makie.set!(textboxes[1],"a string2")
Makie.set!(textboxes[2],"another string2")
I have tried lots of variations like the reset_on_focus=true or not, press enter or not, etc, but 100% of the time I run this I get this error…
ERROR: MethodError: Cannot `convert` an object of type Nothing to an object of type Vector{Point{2, Float32}}
Closest candidates are:
convert(::Type{Array{T, N}}, ::StaticArraysCore.SizedArray{S, T, N, N, Array{T, N}}) where {S, T, N}
@ StaticArrays C:\Users\steve\.julia\packages\StaticArrays\O6dgq\src\SizedArray.jl:88
convert(::Type{Array{T, N}}, ::StaticArraysCore.SizedArray{S, T, N, M, TData} where {M, TData<:AbstractArray{T, M}}) where {T, S, N}
@ StaticArrays C:\Users\steve\.julia\packages\StaticArrays\O6dgq\src\SizedArray.jl:82
convert(::Type{T}, ::AbstractArray) where T<:Array
@ Base array.jl:613
...
with this stack trace…
Stacktrace:
[1] setproperty!(x::Observable{Vector{Point{2, Float32}}}, f::Symbol, v::Nothing)
@ Base .\Base.jl:38
[2] setindex!(observable::Observable, val::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:85
[3] (::Observables.MapCallback)(value::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:431
[4] #invokelatest#2
@ .\essentials.jl:816 [inlined]
[5] invokelatest
@ .\essentials.jl:813 [inlined]
[6] notify
@ C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:169 [inlined]
[7] setindex!(observable::Observable, val::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:86
--- the last 5 lines are repeated 2 more times ---
[18] (::Makie.var"#175#177"{Attributes, Observable{Tuple{Vector{Point{3, Float32}}}}, DataType})(kwargs::Tuple{}, args::Point{3, Float32})
@ Makie C:\Users\steve\.julia\packages\Makie\iECbF\src\interfaces.jl:342
[19] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base .\essentials.jl:816
[20] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base .\essentials.jl:813
[21] (::Observables.OnAny)(value::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:415
[22] #invokelatest#2
@ .\essentials.jl:816 [inlined]
[23] invokelatest
@ .\essentials.jl:813 [inlined]
[24] notify
@ C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:169 [inlined]
[25] setindex!(observable::Observable, val::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:86
[26] (::Makie.var"#1573#1575"{Label, Base.RefValue{GeometryBasics.HyperRectangle{2, Float32}}, Observable{Float32}, Observable{Point{3, Float32}}})(bbox::GeometryBasics.HyperRectangle{2, Float32}, padding::NTuple{4, Int64}) @ Makie C:\Users\steve\.julia\packages\Makie\iECbF\src\makielayout\blocks\label.jl:45
[27] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base .\essentials.jl:816
[28] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base .\essentials.jl:813
[29] (::Observables.OnAny)(value::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:415
[30] #invokelatest#2
@ .\essentials.jl:816 [inlined]
[31] invokelatest
@ .\essentials.jl:813 [inlined]
[32] notify
@ C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:169 [inlined]
[33] setindex!(observable::Observable, val::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:86
[34] update_computedbbox!(computedbbox::Observable{GeometryBasics.HyperRectangle{2, Float32}}, suggestedbbox::GeometryBasics.HyperRectangle{2, Float32}, alignment::Tuple{Float32, Float32}, reporteddimensions::GridLayoutBase.Dimensions, alignmode::Inside, protrusions::GridLayoutBase.RectSides{Float32}, sizeattrs::Observable{Tuple{Union{Nothing, Float32, Auto, Fixed, Relative}, Union{Nothing, Float32, Auto, Fixed, Relative}}}, autosizeobservable::Observable{Tuple{Union{Nothing, Float32}, Union{Nothing, Float32}}})
@ GridLayoutBase C:\Users\steve\.julia\packages\GridLayoutBase\lYdxT\src\layoutobservables.jl:356
[35] (::GridLayoutBase.var"#107#109"{Observable{GeometryBasics.HyperRectangle{2, Float32}}, Observable{Tuple{Float32, Float32}}, Observable{Tuple{Union{Nothing, Float32, Auto, Fixed, Relative}, Union{Nothing, Float32, Auto, Fixed, Relative}}}, Observable{Tuple{Union{Nothing, Float32}, Union{Nothing, Float32}}}, Observable{Any}, Observable{GridLayoutBase.RectSides{Float32}}, Base.RefValue{Union{Nothing, GridLayoutBase.GridContent{GridLayout}}}, Observable{GeometryBasics.HyperRectangle{2, Float32}}})(rdims::GridLayoutBase.Dimensions)
@ GridLayoutBase C:\Users\steve\.julia\packages\GridLayoutBase\lYdxT\src\layoutobservables.jl:226
[36] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base .\essentials.jl:816
[37] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base .\essentials.jl:813
[38] (::Observables.OnAny)(value::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:415
[39] #invokelatest#2
@ .\essentials.jl:816 [inlined]
[40] invokelatest
@ .\essentials.jl:813 [inlined]
[41] notify
@ C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:169 [inlined]
[42] setindex!(observable::Observable, val::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:86
[43] (::Observables.MapCallback)(value::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:431
[44] #invokelatest#2
@ .\essentials.jl:816 [inlined]
[45] invokelatest
@ .\essentials.jl:813 [inlined]
[46] notify
@ C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:169 [inlined]
[47] setindex!(observable::Observable, val::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:86
[48] (::Makie.var"#1572#1574"{Label, Base.RefValue{GeometryBasics.HyperRectangle{2, Float32}}, MakieCore.Text{Tuple{Vector{Point{3, Float32}}}}, LayoutObservables{GridLayout}})(#unused#::String, #unused#::Float32, #unused#::Symbol, #unused#::Float32, #unused#::Float32, padding::NTuple{4, Int64})
@ Makie C:\Users\steve\.julia\packages\Makie\iECbF\src\makielayout\blocks\label.jl:26
[49] invokelatest(::Any, ::Any, ::Vararg{Any}; kwargs::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base .\essentials.jl:816
[50] invokelatest(::Any, ::Any, ::Vararg{Any})
@ Base .\essentials.jl:813
[51] (::Observables.OnAny)(value::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:415
[52] #invokelatest#2
@ .\essentials.jl:816 [inlined]
[53] invokelatest
@ .\essentials.jl:813 [inlined]
[54] notify
@ C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:169 [inlined]
[55] setindex!(observable::Observable, val::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:86
[56] (::Observables.MapCallback)(value::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:431
[57] #invokelatest#2
@ .\essentials.jl:816 [inlined]
[58] invokelatest
@ .\essentials.jl:813 [inlined]
[59] notify
@ C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:169 [inlined]
[60] setindex!(observable::Observable, val::Any)
@ Observables C:\Users\steve\.julia\packages\Observables\PHGQ8\src\Observables.jl:86
[61] setproperty!
@ C:\Users\steve\.julia\packages\Makie\iECbF\src\makielayout\blocks.jl:445 [inlined]
[62] set!(tb::Textbox, string::String)
@ Makie C:\Users\steve\.julia\packages\Makie\iECbF\src\makielayout\blocks\textbox.jl:328