When a SortTable is resized, now the width of the columns and the num… #10
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
So this functionality will automatically resize the columns and the number of displayed rows on a SortTable whenever it is resized, for example in the case of resizing a window frame that is is in.
Here is the code example from the wiki for the SortTable, slightly modified to make resizable using the new functionality for that:
What you will see is that as you resize the window the columns widths will resize and the number of displayed rows will also automatically change to accommodate the new SortTable size.
One interesting effect of these few PR's I've made recently is that you might want to reconsider the SortTable instantiation. Currently you do something like this:
st = StdUi:ScrollTable(window, cols, 14, 24);
The
14
is specifying the number of rows you want in the SortTable. But with the above PR, you would no longer need to specify that. Instead, the functionality can simply automatically determine the number of rows needed based on the height of the SortTable. Any thoughts on this?