addTableCommandInput() in Python last 3 rows don't display if table needs to scroll

addTableCommandInput() in Python last 3 rows don't display if table needs to scroll

tim.collins29V9X
Enthusiast Enthusiast
701 Views
3 Replies
Message 1 of 4

addTableCommandInput() in Python last 3 rows don't display if table needs to scroll

tim.collins29V9X
Enthusiast
Enthusiast

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. 


tableissue.png

 

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.

tableissue2.png

0 Likes
702 Views
3 Replies
Replies (3)
Message 2 of 4

tim.collins29V9X
Enthusiast
Enthusiast

I believe this is a bug in case anyone at Autodesk ever looks for them in the forums.

0 Likes
Message 3 of 4

BrianEkins
Mentor
Mentor

I tried to reproduce it, and it seems to be working OK for me. I'm using Windows. Are you on Mac? Even if you are, I don't know if that's the problem, but it would be an obvious difference.

---------------------------------------------------------------
Brian Ekins
Inventor and Fusion 360 API Expert
Website/Blog: https://EkinsSolutions.com
0 Likes
Message 4 of 4

tim.collins29V9X
Enthusiast
Enthusiast

Hi Brian, 
Apologies for the delay. I am on and off this project and just got back.

I am running on Windows. 

It does make sense that this would be a platform-specific API related to computing which of the UI widgets are visible.  Someone ought to fix it eventually assuming no other high priority items. I'm certainly not blocked by it.


Tim

0 Likes