When you add a
GuiTextListCtrl inside a
GuiScrollCtrl, then change the text list's parent using
otherScroll.addParent, the text list no longer has any rows in it.
This is happening on the latest v6.
The following code can be used to replicate the problem:
PHP Code:
//#CLIENTSIDE
function onCreated() {
if (Test_Window != null) {
Test_Window.destroy();
}
// draw a window with two scrolls, one of which has a list in it
new GuiWindowCtrl("Test_Window") {
profile = GuiBlueWindowProfile;
clientWidth = 200;
clientHeight = 200;
clientRelative = true;
new GuiScrollCtrl("Test_ScrollOld") {
profile = GuiBlueScrollProfile;
width = Test_Window.clientWidth;
height = (Test_Window.clientHeight / 2) - 5;
new GuiTextListCtrl("Test_List") {
profile = GuiBlueTextListProfile;
for (temp.i = 0; temp.i < 10; temp.i ++) {
this.addRow(0, "Row " @ temp.i);
}
}
}
new GuiScrollCtrl("Test_ScrollNew") {
profile = GuiBlueScrollProfile;
width = Test_Window.clientWidth;
height = (Test_Window.clientHeight / 2);
y = Test_ScrollOld.height + 5;
}
}
// now, move Test_List from Test_ScrollOld to Test_ScrollNew
echo("rows before: " @ Test_List.rows.size());
Test_ScrollNew.addControl(Test_List);
echo("rows after: " @ Test_List.rows.size());
}
In F2, the output is:
Quote:
Originally Posted by F2
rows before: 10
rows after: 0
|
The expected output is:
Quote:
Originally Posted by F2
rows before: 10
rows after: 10
|