python - 是否可以隐藏网格中的特定列?

标签 python wxpython

我正在使用 wxpython 和 wx.Grid... 我有一个包含许多列的通用网格 - 使用 SetColumn(self, column) 创建,我希望能够根据用户安全权限显示和隐藏特定列。

我读到 self.SetColMinimalAcceptableWidth(0) 可能有用?如何在特定列上使用它?当我需要显示该列时,如何将其恢复到原始大小?

最佳答案

网格手册有以下条目:

HideCol(自身, col)

Hides the specified column.

To show the column later you need to call SetColSize with non-0 width or ShowCol to restore the previous column width.

If the column is already hidden, this method doesn’t do anything.
Parameters: col (int) – The column index.    

对于 self.Mygrid 来说:

self.Mygrid.HideCol(0)

将隐藏第一列。

关于python - 是否可以隐藏网格中的特定列?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32046360/

相关文章:

python - wxPython。创建一个包含四个静态大小框的面板

python - Tensorflow Estimator API 在评估模式下保存图像摘要

python - Python 中字符串的基数排序

python - Gensim word2vecmost_similar通过#前缀过滤

python - 解析此目录路径而不丢失斜杠

python - wxPython:线程化 GUI --> 使用自定义事件处理程序

Jinja2 中的 Python lambda

python - 在 python 3.4、ubuntu 15.10 上使用 pip 安装 pandas 时出错

python - 在 sizer 中获取鼠标位置? wxpython

python - 如何在wx python中制作一个简单的 watch