tkintertable icon indicating copy to clipboard operation
tkintertable copied to clipboard

How to autoResizeColumns correctly

Open MRES1 opened this issue 5 years ago • 0 comments

Hello, I'm working with your wonderful module, thank you form all of your work.!

I have two questions if you can help me out with them I would be really thankful.

¿ How can I correctly use the autoResizeColumns() method ? well, I'm calling the method but I don't see any difference.

This is a little code snippet:

 tframe = Frame(self)
 tframe.pack(fill=BOTH,padx=25, pady=25)
      
self.table = TableCanvas(tframe,
                            data=data,
                            cellbackgr='#F1EFEF',
                            thefont=('Arial', 12),
                            rowheight=30,
                            bg="red",
                            reverseorder=1,
                            grid_color="black",
                            selectedcolor="gray",
                            multipleselectioncolor="#CCCCFF",
                            cellwidth=180,
                            height = 500
                            )
     
        self.table.show()
        self.table.autoResizeColumns()

I looked at the source code and we can find that this method is basically a call for adjustColumnWidths() and redrawTable()

In the second place, we can see that I have a cellwidth of 180 and happens that when I run the code some values of the tables are not shown till I click and drag one of the scroll bars. What could ber wrong here?

image

So at this point, I drag one of the scroll bars and the data is shown correctly. If we change the cellwidth to say 100 data is shown correctly but scroll bars disappear.

MRES1 avatar Jul 10 '20 17:07 MRES1