简体   繁体   English

使各种小部件的宽度与Treeview列相对应

[英]Make width of various widgets correspond with treeview columns

As an example, I have an entry, and several optionmenus located below a treeview widget. 举例来说,我有一个条目,并且在treeview小部件下面有几个选项菜单。 I am using the grid manager, and the treeview has a columnspan equal to all the widgets along it's lower side. 我正在使用网格管理器,并且Treeview的columnpan等于其下侧的所有小部件。

Since specifying the width of an entry or an optionmenu is in characters (the width in px of those characters is in turn based on the font size/family chosen for the widgets), and specifying the width of a column in a treeview is in pixels, how can I calculate the lengths of both a column and the widget underneath it so that they are visually linked by their positions (the length being the same)? 由于指定条目或选项菜单的宽度是以字符为单位的(这些字符以px为单位的宽度又取决于为小部件选择的字体大小/系列),因此在树视图中指定列的宽度以像素为单位,如何计算列和其下的小部件的长度,以便它们在视觉上通过其位置链接(长度相同)?

I found a great example of treeview. 我找到了树状视图的一个很好的例子。 It might help to provide some insight. 这可能有助于提供一些见解。 Here is the link 链接在这里

Create a table using treeview with control of column widths 使用Treeview创建表并控制列宽

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM