Consequences of RectControl.lockleft = false

What are the Consequences of RectControl.lockleft = false?
If I want a control to be centrally located (both sided are then locked) and then resize the window,
then the control’s width changes to reflect the window’s width.

If I unlock a direction instead of locking both, then it will stay centered, and I cannot move the control in the compiled version. (On a Mac)
So, what are the consequences of unlocking?

Asking the same question in a different topic won’t change the answers provided previously

I just noticed you responded. I probably wouldn’t have asked.
It now seems a little different question.
I don’t think it matters, but for some reason XOJO requires it in the IDE. Does it?

Again… LOCKxxx relates only to RESIZE, and then only if YOU don’t override it… which you are.

its really that simple…

to put it simply… in the situation you have, IGNORE Lockxxx (and move your code from OPEN to RESIZE)

Unless I see otherwise, I will avoid doing a resize event and try locking = false. Those are the controls that are affected.

OK… I give up… you obviously are not paying attention…

Why would you avoid the Resize event? when two of us specifically told you that was the event you WANT to use?

  • in this situation, forget about Lockxxx (except maybe for top or bottom (but not both))
  • MOVE your code from OPEN to RESIZE… or better yet, put it in a method and call that method from OPEN AND RESIZE (or RESIZED if you don’t care if its is “live”)

No, it will not. If you want it to stay centered, you need to move it in code, in the Resize/Resized events, like Dave told you.

Just for clarity, the desktop behavior is different from the web in this circumstance. On web, you can unlock both left and right to have a control “float” at a certain percentage. You cannot do that on the desktop and getting that functionality requires doing it in code which fires in the Resize event(s) of the Window.