On Sat, Aug 31, 2024 at 6:56 AM Thomas Passin wrote: Short answer: yes, with a few quirks in the case of added widgets (ones > that are not VR/VR3 and RPCalc). These widgets may become lost but still > retain their resources and their event hooks. >
Excellent. We can deal with event handlers later, if need be. My script to restore a default layout examines the main and secondary > splitters and removes any splitters that were added. That works but if one > of these added splitters contain an unknown widget (again, one of > VR/VR3/RPCalc) its removal might lead to some dangling python objects. This > is the same problem of deleting any PyQt widget: just running deleteLater > removes the C++ parts but not necessarily the Python ones. The script could > be modified to also remove added layouts and other widgets. > Alright. Again, we can deal with the complications later. My opinion is that this is an acceptable compromise. Only script writers > will know how to add other widgets. If they know that they can also figure > out how to remove them or keep them around but hidden for reuse in another > layout. Of course we would write some guidance for them. > I agree. Long run: > > Create a core Widget, inheriting from QWidget, that has known methods for > finding, hiding, deleting, and reusing itself. > I prefer not to create subclasses of gui objects unless necessary, so I would prefer these be DynamicWindow methods, but let's defer this discussion. I would be happy to take the lead in this work if you would like that. > Thanks. Having you do the work is the fastest way forward for you. The more general approach (getting reload-outline to work properly without *ever* calling restart-leo) might be ideal, but we both know that way isn't as easy as it appears. Edward -- You received this message because you are subscribed to the Google Groups "leo-editor" group. To unsubscribe from this group and stop receiving emails from it, send an email to leo-editor+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/leo-editor/CAMF8tS3m9frb-VUqHKh3fFt7VYU%2BqbM%2B1z4B3TxX1VVHV%2B9ZdA%40mail.gmail.com.