addTableCommandInput() in Python last 3 rows don't display if table needs to scroll
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm trying a table rather than a drop down list for simulating a File: menu. The last 3 rows do not display properly, even if I change the order of the rows. It seems that I always get a vertical scrollbar on the extreme right side of the table and not text showing.
I have some clues that suggest that this might be a bug in the API library. The only thing that is different about the last 3 rows is that they are not visible when the UI is created. They don't fit the space and you have to move the scroll bar to see them. When I move the scroll bar I see that all the rows that are not initially visible do not draw properly. It is almost as if the logic that triggers a scroll bar on the text is getting triggered by the size logic of the surrounding table. If I eliminate scrolling by setting the number of rows (min and max) then they do show properly. See the screen capture at end of this post. (I used to fix a lot of bugs back when I was working.)
Here is my utility function to add rows to a table:
self.fileMenuTable: TableCommandInput = fileTabInputs.addTableCommandInput(
'fileMenuTable', 'File', 2, "1:10")
self.fileMenuTable.isFullWidth = True
row: int = 0
row = self.addFileMenuItem('fileNewMenuItem', "New", 'new', row)
row = self.addFileMenuItem('fileOpenMenuItem', "Open", 'open', row)
row = self.addFileMenuItem('fileCloseMenuItem', "Close", 'close', row)
row = self.addFileMenuItem('fileSaveMenuItem', "Save", 'save', row)
row = self.addFileMenuItem('fileSaveAsMenuItem', "Savea", 'saveas', row)
row = self.addFileMenuItem('fileExportCSVMenuItem', "Export", 'exportcsv', row)
row = self.addFileMenuItem(
'filePublishMenuItem', "Params", 'publishparams', row)
Here is the code that makes the row.
def addFileMenuItem(self, id: str, prompt: str, iconName: str, row: int) ->int:
fileTabInputs = self.getInputsForTab("file_tab")
iconPath: str = '.' + os.sep + "resources" + os.sep + "buttons" + os.sep + iconName
menuItem: BoolValueCommandInput = fileTabInputs.addBoolValueInput(
id, '', False, iconPath, True)
self.fileMenuTable.addCommandInput(menuItem, row, 0)
menuItemText: TextBoxCommandInput = fileTabInputs.addTextBoxCommandInput(
id + "Text", "", "<b>" + prompt + "</b>", 1, True)
self.fileMenuTable.addCommandInput(menuItemText, row, 1)
row += 1
return row
The last three (does not seem to matter which) have no text, just a peculiar scroll bar on the right side.
SO when I add this code:
self.fileMenuTable.maximumVisibleRows = 7
self.fileMenuTable.minimumVisibleRows = 7
the issue is no longer evident though I don't have access to scrolling, but I can live with that.