所以我正在使用tkinter中的嵌入式用户可编辑表。我想给PlateLayout类提供一组自定义行,而不是默认的1,2,3 ...
import Tkinter as tk
from tkintertable.Tables import TableCanvas
class PlateLayout:
def __init__(self, parent):
self.parent = parent
def make_frame(self):
self.the_frame = tk.Frame(self.parent)
self.the_frame.pack()
def make_table(self):
self.the_table = TableCanvas(self.the_frame, rows=8, cols=12)
self.the_table.createTableFrame()
def make_all(self):
self.make_frame()
self.make_table()
root_win = tk.Tk()
app = PlateLayout(root_win)
app.make_all()
root_win.mainloop()
我看过重命名列的屏幕截图,但是没有找到关于如何以编程方式执行此操作的参考。
答案 0 :(得分:1)
这是从https://code.google.com/p/tkintertable/wiki/Usage#Change_column_labels
引用的快速更改代码可让您设置自定义标签;
SELECT bottom.value, mblue.selection, COUNT(mblue.id)
FROM TOP
INNER JOIN middle AS mred ON mred.top_id = top.id
INNER JOIN bottom ON bottom.middle_id = mred.id
INNER JOIN middle AS mblue ON mblue.top_id = top.id
WHERE mred.category = 'red'
AND mblue.category = 'blue'
AND bottom.value in (1, 2, 3)
GROUP BY bottom.value, mblue.selection