Force Component.setSize()?

My Components and custom LookAndFeel use Lua to ease GUI design. My Lua wrapper is a ChangeBroadcaster that components can listen to in order to repaint when my Lua scripts change. My problem is with the resized() callback. As I also determine children components geometry with Lua, I’d need a way to force the resized() callback to be called. From my changeListenerCallback, if I just call setSize (getWidth(), getHeight()), it doesn’t work because JUCE checks if bounds have actually changed.

Any advice?

Thanks in advance. Also, greetings to the team and forum users. Hope everyone is safe.

Hmm, why don’t you call resized() explicitly? It’s a public method after all

Programming is all about naming things well.

You’ve written some code which updates the layout of your components.

So name that chunk of code: put it in a function called e.g. “updateLayout”. Then you can call it whenever you need to update the layout. So call it from resized(), as well as any other events that make sense.

1 Like

Thanks for your replies. For some reason I acted as if resized() was the only moment to set children components bounds… :upside_down_face: