I'm making a custom scene with three custom windows. One is a command window that lists nine options for factions to ally with, and then a basic window lists off some information about a faction that has been selected from the command window. I want the player to select two factions, then select some bonus options from both factions. For (supposed) simplicity, I want to use the same command and display windows for each of these options.
Throughout this process, the command window has 9, 8, 4, and then 4 items in it. I want that window to resize itself after each choice. I found an archived thread that offered this snippet:
self.height = fitting_height(@list.size)
create_contents
The first line is supposed to resize the menu, but has the side-effect of emptying the contents. The second line refills it. However, when I try to run it myself, I get an error at the first line mentioning a "disposed window." I'm not entirely sure why this is, since nothing is being disposed - at least as far as I understand it.
Why doesn't this work? Is there a different method for resizing a command window?