I have a bit of a problem with losing the connection to my web dialog. My web dialog is using a SelectionObserver to track what is being selected.
However, when I open a new model… I can no longer get the handle to the dialog window.
So here in this code…
class MySelectionObserver < Sketchup::SelectionObserver def myDialog dialog @gp = dialog end def onSelectionBulkChange(selection) if @gp.dialog.visible? @gp.update() end end def onSelectionCleared(selection) if @gp.dialog.visible? @gp.update() end end end class MyAppObserver < Sketchup::AppObserver def onOpenModel(model) if @gp != nil // This block is where I would reinitialize my web dialog, however it never gets called as @gp is always nil.... else puts "can't find it... the web dialog is now unresponsive..." end end end Sketchup.add_observer(MyAppObserver.new)
Thoughts on how I can maintain a persistent handle to a web dialog with a SelectionObserver?