Redraw policy on overlapping views


I’ve just noticed something a bit strange, but I don’t know if it’s a design choice.

I have a CTextLabel and a CTextButton inside of it (and above it, considering the Z axis), so the 2 views are overlapping.
When the button is clicked, this causes the label text to change (simply calling the “setText(…)” method), but the change is not reflected on the GUI. In fact, the label text remains the same.
Moving the button completely outside the text label rect solves the issue.

Is this by design?
Rearranging the views to solve the problem is not a big deal, but I’d like to know if I’m missing something here.

Thanks in advance,

Hi Federico,
the redraw policy depends on how you use VSTGUI. If you only use the main thread to call into all VSTGUI objects, then you can set CView::kDirtyCallAlwaysOnMainThread to true and your issue should be solved. But if you are calling setDirty() from a secondary thread (which is popular in the VST2.x world) then this is not possible and you should not overlap views.

I hope this helps.

Hi Arne, I take it that overlaping views when calling setDirty() from a secondary thread will never be an option?