hi,
I’m trying to create an interactive plot using GLMakie, one of the thing I’m doing is adding menus from which the user can choose the data to plot.
Here is a simplified code which create the menus GridLayout:
using GLMakie
fig = Figure()
menugrid = GridLayout(tellwidth = false, tellhight= false)
x_menu_l = Label(fig.scene, "X : ")
x_table_m = Menu(fig.scene)
x_var_m = Menu(fig.scene)
menugrid[1,1:3] = [x_menu_l, x_table_m, x_var_m]
y_menu_l = [Label(fig.scene, "Y : ") for _ in 1:4]
y_table_m = [Menu(fig.scene) for _ in 1:4]
y_var_m = [Menu(fig.scene) for _ in 1:4]
y_rm_m = [Button(fig.scene, label = "Rem") for _ in 1:4]
# adding 4 more rows to the grid
for (a,b,c,d) in zip(y_menu_l, y_table_m, y_var_m, y_rm_m)
menugrid[end+1,1:4] = [a, b, c, d]
end
My question is, how can I remove the i’th row from the menugrid and update the GUI?
thanks in ahead
for c in contents(menugrid[end, :])
# clean up plots and some observables
empty!(c.blockscene)
delete!(c)
end
trim!(menugrid)
I’m not sure how complete the observable cleanup is with this. I wouldn’t be surprised if this leaves behind some ghost interactions, like an invisible button you can still press. If that is the case it would be good to open an issue for this.