Latency in switching tabs in TabbedComponent

I have a TabbedComponent with 3 tabs in it where each tab is a component with nothing to draw(paint function is empty). but switching tabs is still taking about 300-500ms. is this normal or am i doing something wrong? what are the things that make switching slow other that repainting.

Can you try running the DemoRunner to see how the TabbedComponents in that work for you? There is a TabbedComponent for selecting between the demo, code, and settings, but also you’ll find one in GUI >> WidgetsDemo.

I experienced a similar lag when receiving the callback DragAndDropContainer::dragOperationEnded(), which was invoked with a similar delay after the actual end of the drag and drop gesture performed with the mouse.

Turns out that the delay was due to the fact that that callback is called by a Timer that periodically checks the situation every 200ms or so, instead of in response to the actual mouseUp event that ended the gesture (or equivalent event)

Maybe this is a similar case where a Timer is involved?

1 Like

Thanks for the reply , and yes the similar lagging is present in the demo from the DemoRunner’s WidgetsDemo. But in applications like vital this happens instantaneously i’m just wondering what is the reason behind it.

Thanks for the reply. do you have any idea how to make it as fast as possible rather that timed callbacks?

found the reason, it is NOT a problem in JUCE, it is working perfectly fine with mouse, i think the latency is from my Laptop’s TouchPad.

2 Likes