合并 wx.Grid 中的相邻单元格

发布于 2025-01-03 12:35:43 字数 59 浏览 2 评论 0原文

是否可以合并 wx.grid 中的相邻单元格?我的意思是水平的作为行中的单元格和垂直的作为列中的单元格。

Is it possible to merge adiacent cells in a wx.grid? I mean both horizontal as cells in a row and vertical as cells in a column.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

小ぇ时光︴ 2025-01-10 12:35:43

有一种方法可以使文本跨越网格小部件中的多行或多列。 wxPython 演示中有一个名为 GridSimple.py 的示例。参见第 64-67 行。它们的内容如下:

self.SetCellValue( 9, 1, "This default cell will overflow into neighboring cells, but not if you turn overflow off.");
self.SetCellSize(11, 1, 3, 3);
self.SetCellAlignment(11, 1, wx.ALIGN_CENTRE, wx.ALIGN_CENTRE);
self.SetCellValue(11, 1, "This cell is set to span 3 rows and 3 columns");

注意:您不需要分号。我不知道为什么他们会出现在例子中。

There is a way to make text span multiple rows or columns in a grid widget. There's an example in the wxPython demo called GridSimple.py. See lines 64-67. They read as follows:

self.SetCellValue( 9, 1, "This default cell will overflow into neighboring cells, but not if you turn overflow off.");
self.SetCellSize(11, 1, 3, 3);
self.SetCellAlignment(11, 1, wx.ALIGN_CENTRE, wx.ALIGN_CENTRE);
self.SetCellValue(11, 1, "This cell is set to span 3 rows and 3 columns");

Note: You don't need the semi-colons. I don't know why they're in the example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文