WebContainer lockleft/lockright not functioning?

I’ve added a simple WebContainer to a webpage at runtime using embed within. It appears correctly when first added to the page, but when the page is resized the container does not resize with it. I’ve set all of the lock left/top/right/bottom to true in both the IDE and on the instance of the container at runtime. Couldn’t find anything very close on the subject in the forums with a quick search.

Closest I found was this: <https://xojo.com/issue/18214>

But that can’t be the only reported issue on this subject, and it’s not exactly my problem since I’m not even intentionally trying to change the lock from the defaults saved in the IDE and I’ve set the locks in code as well.

Just figured it out. Looks like you need to manually set the locks (regardless of what you have in the IDE) after the instance is created but BEFORE you use EmbedWithin. Fun.

Hhmmm…I’m not having any issues with this. Make sure you do it before the embed within.

Ah. beat me to it.

Thanks all for the suggestions, However…

I just tested again with the lock code before EmbedWithin, and now the container is drawn at the left edge of the page, even though the x property read 244. When the Lock code is removed the containers are drawn in the correct location but of course do not stay centered when the window is resized. Sure seems like a bug to me. Running on MacOS 10.12.4 Xojo 2017 1.1.

[code]dim c As ccRow
dim x,y,w,h,i,offset As integer

c = new ccRow
w = c.Width
h = c.Height
x = self.Width / 2 - (w/2)
y = 120

offset = h + 4

for i = 1 to val(rows.Text)
c = New ccRow
c.LockLeft = False
c.LockRight = False
c.EmbedWithin(self,x,y,w,h)
y = y + offset
next

self.MinHeight = y + 10[/code]

I think you are experiencing this bug: <https://xojo.com/issue/46463>

[quote=328560:@Bart Davis]Thanks all for the suggestions, However…

I just tested again with the lock code before EmbedWithin, and now the container is drawn at the left edge of the page, even though the x property read 244. When the Lock code is removed the containers are drawn in the correct location but of course do not stay centered when the window is resized. Sure seems like a bug to me. Running on MacOS 10.12.4 Xojo 2017 1.1.

[code]dim c As ccRow
dim x,y,w,h,i,offset As integer

c = new ccRow
w = c.Width
h = c.Height
x = self.Width / 2 - (w/2)
y = 120

offset = h + 4

for i = 1 to val(rows.Text)
c = New ccRow
c.LockLeft = False
c.LockRight = False
c.EmbedWithin(self,x,y,w,h)
y = y + offset
next

self.MinHeight = y + 10[/code][/quote]
This is being discussed over here.