1

I m new to Beeware and Toga and i don't know how to make the column width bigger, so that the full text is displayed. When i execute the app in Linux the table works fine, but on Windows this happens

How can i make the table colums wider by default? I ve tryed every option in the table style but nothing works.

Small Table Column Width

Thanks :)

Wizard
  • 63
  • 4

2 Answers2

1

That's a known limitation/bug at present; there isn't very good style control of Tables in general. On Windows in particular, the columns are laid out with their original sizes, and then aren't adjusted when content or style changes. In all likelihood, there's a simple way to fix this in the internals (i.e., the implementation is missing a call to refresh the Winforms layout, or something like that), but I can't point you at what that might be.

freakboy3742
  • 1,026
  • 10
  • 15
0
def change_col_width(self, col, width):
    self.table._impl.native.get_Columns().get_Item(col).set_Width(width)

of course, this is a hack - it must be merged into toga_winforms/widgets/table.py and toga/widgets/table.py to make it official, and then (try) to implement on as many other platforms as possible.

Auto resize (defined per column)

self.table._impl.native.get_Columns().get_Item(col).set_Width(-1)

Google keywords for the Windows(winforms) impl., "winforms listview Columns Auto Resize"

I haven't yet checked android, linux.

Berry Tsakala
  • 15,313
  • 12
  • 57
  • 80