Shared Height prevents scripts from resizing listviews

Following some workaround suggestions from Make dialog editor size just a default, not a fix minimum - #2 by Leo I've set the height listview to a small value of 10 so that the window can be freely user-sized down, and both listviews have SH prop so that window resizes maintains their relative positions

But then it seems that I can't resize any of the listviews in the script (see an example attached) based on the initial number of inserted rows (the example doesn't insert any rows, just tries to resize the listview control)

And a more general question: am I correct that there is currently no way to replicate all dialog xml template functionality in scripting? For example, I can't disable the "Resize" template property from Shared Height, adjust the size/position, then reenable it back?

Test.dcf (4.0 KB)

I'm not sure scripting will ever be that flexible when it comes to custom dialog layout and resizing logic. The aim is to make it easy for scripts to put up a UI that can be resized, but if you want more power/complexity to do more esoteric resizing/layout changes at runtime then it might make more sense to have the script call a program which displays its own UI.

All "flexibility" required here is being able to set all the properties defined via xml in the intitialization phase. Why is this not exposed?