GUI freeze with repaint on component


#1

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?


#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.


#3

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.


#4

Why would you call repaint() inside paint()??


#5

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.


#6

Try using a Timer to repaint it instead.


#7

-


#8

Quick test and Timer seems to work better, thanks!