addChildPanel - Repaint Issue
-
We use a lot of child panels in our plugin, but if we try to redraw the child panels, they will reset to the default panel state and there's no way to correct it. This happens very consistently in both in HISE and the compiled plugin.
What it looks like after redrawing:
What it's supposed to look like (ignore image size difference):
-
@Casey-Kolb I'm asking for this bug to be resolved for a while...
-
@ustk It's a shame because the child panel system is so powerful. All of our preset and sound pack browsers are built with them, and they're so flexible. But this bug makes the whole thing look so unprofessional to the user.
-
Yeah this is the ghost panel issue striking again. My "solution" is to do all my painting on the parent panel, using the children only for positioning and mouse callbacks. This is not a good solution but it works until the problem is fixed.
Here's one of my posts from my beta thread, including a demo project:
@d-healey said in [beta test] Finally I have a new product (almost)!:
@Christoph-Hart I've made a minimal project that demonstrates the draw image issue. I'd be grateful if you could try it out and see if there is anything obvious I'm doing wrong.
Things I've noticed:
- The problem is intermittent
- The problem only occurs when drawing on child panels
- I have only been able to create the issue using an image from an expansion. Using images loaded into the pool from the project's image folder don't seem to trigger the problem.
- Calling child.loadImage after child.setPaintRoutine greatly reduces the problem occurring, you'll notice in the minimal project I am intentionally calling loadImage first in order to trigger the issue more often.
- The problem happens regardless of OpenGL state.
- It occurs on Windows and OSX more often than on GNU/Linux.
- The problem always triggers the first time you turn the button on after recompiling the script - should make it easier to debug :)
When you load the project and turn the button on a child panel should be added and the image from the expansion should be drawn. When you turn the button off the image should be unloaded from the child panel and the child panel should be removed. Click it on and off repeatedly and sometimes the issue will occur sometimes it wont.
-
@d-healey The child panels also constantly crash my HISE when I recompiile. I've gotten in the habit of just completely closing and reopening HISE when I need to recompile. Not sure if you've experienced this too? We're using hundreds at a time, so that could be part of it.
-
@Casey-Kolb I haven't experienced that, but I'm only using a few.
-
@d-healey Hey is there any fix to this? It seems like it still draws the ghost panels :(
-
@oskarsh So this has been fixed long ago. The child panel system is very reliable and I use it everywhere I can just because I like
The reason you have this (well, without a snippet it's hard to be sure) might be because you create new children without removing the old ones.
When you create/update you child panels, be sure to clean the parent firstI always call this prior rebuilding the children:
inline function removeDanglingPanels() { for (child in mainPnl.getChildPanelList()) child.removeFromParent(); } removeDanglingPanels();
I also call this at init to be sure the parent is empty
-
@ustk that’s the solution. Of course! Thank you.
Somehow I was under the impression that they would get clearer automatically. Thank you!