Child panels seem to hang around on recompile
-
First time using child panels so I might be doing something wrong.
Steps to recreate.
Use the horizontal list snippet from the docs
Add a few panels
Change the line height to 60 -const var lineHeight = 60;
Hit compile
Add a few panels again.
The panels from the previous adding of panels are still there and the new ones go on top of them but the old ones don't appear in the list array... -
@d-healey Confirmed!
-
Here's one solution/workaround, call this in on init.
inline function removeAllChildren(panel) { local children = panel.getChildPanelList(); if (children.length > 0) for (x in children) x.removeFromParent(); }
-
@ulrik I remember there were problems with childs when I made animation program, I'll take a look to see what I did to solve it
-
@d-healey Yeah I got that from the beginning and it hasn't been fixed yet. I call them ghost panels because they appear when and where they want
The workaround I am using is that I always empty a parent panel from its children and rebuild them.
for (c in Panel1.getChildPanelList()) c.removeFromParent(); // Rebuild here
-
@d-healey Yeah that's it... But I always call it first in my factory function, so it's done each time you modify the children content.
-
@ustk said in Child panels seem to hang around on recompile:
so it's done each time you modify the children content.
Explain please... :)
-
@d-healey Making a snippet...
-
HiseSnippet 1348.3ocsW0uaaaCDmJMpqVadXcXO.D4ujVbMjaS6JfaQc9xaAKowHNKs.AAELRz1DUlTPhNIFE4e1SVeT5ivdC1NRJESY6jUDfxDXXde9i2cj24dYhHZdtHC4T63ooTjyO31eJWNZ6QDFGs2NHmu2sGgSSNllKQaMMkjmSiQNNO32UB3TaUjd8OuYKRBgGQmQBgNQvhn6yFyjyn1qyexRR5RhoGyFaI8Fc1KRv2VjHl.f4AtgnTRzGICouknDaEWjyC2MlIEY8kDIMG4r5Vh3o8GItjaj+DVN67DpZSKTevPFxcEIwJDqnh1dDKItW4gNGAVo2rPvCLgfew8.VL6F5yBE+jlAdlF1wCmUtK30xFdge8vywBdqZf2ic6GkwRky3XRS6wkzrADHEXCKirnUd0Cc2V.RvkMGS9HsaFr4FM7eQXXC7SedXP65d08fDQtDeAICqS8svuFWp6Ppbaw3TAG13ulg8ZAs8LeqYNEnNhxFNRtVCLXtJVaex42k0LrUVyRmDFm9GZCB58rv10qvKWQ8zy.pVHnGjujGIlHA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0qTPcnRU89P0dUjoOkGq27uvpfYK0dmBlsJYhFShxDeHx71nZb7Goo.Xhq+UI0bOPsG2BoeuTUWF1LDMF9UBeHJREJdBf8kqySuG57r6gNabOz442Ccdw8Pme6dnyKuScT+.sMmHEiMWS.B81U2DwwYWNApxzUjn+C5xmA2A
-
Aha I understand what you're doing now, thanks!
-
@d-healey Note that the list isn't the children list! Just any object you want to create children from...
I don't reference first-level children, because, in the end, you don't need it. At least I haven't seen a reason yet. And even if in the doc Christoph made an external list for children, he told me not so long ago it's bad to reference externally... So I came up with this solution. -
@Christoph-Hart Revisiting child panels today, this bug is still there.
-
@d-healey Confirmed, got this bug since child panels have been implemented...
It happens every now and then both in Hise and binary -
@ustk I also notice if you put a
Console.print
in the child panel's paint routine you can't get rid of it unless you reopen the project :p -
@d-healey Wait, what?
-
@d-healey But it's no use anyway in a binary since all console related functions are ignored...
-
@ustk Yeah but it's really annoying when you're figuring out your paint routines and test messages you've been using keep popping up in the console every time you hit compile.
-
@d-healey Oh I understand now, forget my message above :)