I have an Issue with my whole plugins GUI freezes when calling repaint() on a component... even an empty component.
To isolate a little I made an empty TestComponent inheriting component with an empty paint()-method so no time spent there.
From my main window component's paint method I call repaint on my testComponent. If I comment out the repaint-call all works as usual.
The same code works well at my mac with xcode but not on my windows machine.
Kind of lost here, any ideas what I could be doing wrong?
jules
July 2, 2014, 10:21am
2
Create the smallest possible code snippet that shows the problem, and post it here. You're probably just doing something silly, but I can't guess what it is.
In my main Components class I have a private "Component* testComponent2"
In my main components constructor:
testComponent2* = new Component("test2");
testComponent2->setBounds(1,2,3,4);
addAndMakeVisible(testComponent2);
In my main components paint() I just do.
testComponent2->repaint();
If I skip calling the setBounds it works.
jules
July 2, 2014, 10:50am
4
Why would you call repaint() inside paint()??
It is an oscilloscope I want repainted all the time.
The oscilloscope can also be clicked so it made sense to make in a Component.
jules
July 2, 2014, 11:02am
6
Try using a Timer to repaint it instead.
Quick test and Timer seems to work better, thanks!