question
I note that delete(obj,widget,...)
requires the container/parent obj
of the widget that is to be deleted. Is there an easy way to pull this from widget
directly?
context
I'm trying to write a quick 'foolproof' widget refresh function that deletes and re-adds the same widget (a la https://stackoverflow.com/a/6571570/2023432) or another one to replace it, and ran into the above problem early:
refresh.widget <- function(old.widget, new.widget = old.widget) {
delete(old.widget$container, old.widget)
new.widget
}