OpenSmock / Pyramid

Pyramid is a Graphical User-Interface (GUI) builder and editor for Bloc and Toplo.
MIT License
33 stars 6 forks source link

Adding ToTabPane on Pyramid create lots of child elements #208

Open LANDAISB opened 2 months ago

LANDAISB commented 2 months ago

I try to add a ToTabPane on Pyramid.

Maybe two probelms :

  1. It creates a ToTabPane with a body (ToPane) and a header (ToTabPaneHeader). The header contains 3 childs ToPane and one of them contains also 3 childs (ToElement and ToPane). It seems it's a lot of childs/subchilds, is it normal ?

  2. If I save and re-open Pyramid, it duplicates all childs under each ToTabPane

toTabPanePyramid

Nyan11 commented 2 months ago

The bug is present because the ToTabPane is a subclass of ToPane, and in Toplo-Serialization i decided to serialize the children of ToPane.

But it does not make sense to serialize the children of ToTabPane, we should only serialize the "tabs" and not the children

Nyan11 commented 2 months ago

I fix the serialization, it should not recreate the elements infinitly. But ToTabPane uses BlockClosure and it is complicated to serialized BlockClosure.

Currently the ToTabPane will try to serialize the ToTab. I can deactivate this functionnality if needed