Tk grid like interface for a window

I was struggling with window resize events in legacy code…
I noticed that Xojo has added a desktop grid for such issues.
I tried using it and had to define new interfaces and event handlers and felt that was a bit of a risk..

I came up with a simple solution that extends the desktop window class with a method called Pack.

I put a bunch of controls on a window in the IDE in a layout that is good for the ide.
In this case 9 push buttons each with different anchor settings.

in my opening event i set up the table by adding rows of cells.. each cell has a name that corresponds to the name of the control on the window.

My window opening event.

layout = New TableLayout
layout.Columns = 3

layout.Rows.Add(Row("Button1","Button2","Button3"))
layout.Rows.Add(Row("Button4","Button5","Button6"))
layout.Rows.Add(Row("Button7","Button8","Button9"))

Self.Pack(layout)

Inside the IDE…

At runtime.

One module.. pretty simple.

It’s on GitHub