質問編集履歴
3
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -65,8 +65,8 @@
|
|
65
65
|
# インサート
|
66
66
|
id = []
|
67
67
|
id.append(tree.insert("", "end", value=["aaa", "bbb", "ccc"]))
|
68
|
-
id.append(tree.insert("", "end", value=["ddd", "eee", "fff"], tags=
|
68
|
+
id.append(tree.insert("", "end", value=["ddd", "eee", "fff"], tags="mytag1"))
|
69
|
-
id.append(tree.insert("", "end", value=["ggg", "hhh", "iii"], tags=
|
69
|
+
id.append(tree.insert("", "end", value=["ggg", "hhh", "iii"], tags="mytag2"))
|
70
70
|
|
71
71
|
# 後からtag変更
|
72
72
|
#tree.item(id[1], tags="")
|
2
修正
title
CHANGED
File without changes
|
body
CHANGED
@@ -63,10 +63,15 @@
|
|
63
63
|
tree.tag_configure("mytag2", background="green", foreground="yellow")
|
64
64
|
|
65
65
|
# インサート
|
66
|
+
id = []
|
66
|
-
tree.insert("", "end", value=["aaa", "bbb", "ccc"])
|
67
|
+
id.append(tree.insert("", "end", value=["aaa", "bbb", "ccc"]))
|
67
|
-
tree.insert("", "end", value=["ddd", "eee", "fff"], tags=("mytag1"))
|
68
|
+
id.append(tree.insert("", "end", value=["ddd", "eee", "fff"], tags=("mytag1")))
|
68
|
-
tree.insert("", "end", value=["ggg", "hhh", "iii"], tags=("mytag2"))
|
69
|
+
id.append(tree.insert("", "end", value=["ggg", "hhh", "iii"], tags=("mytag2")))
|
69
70
|
|
71
|
+
# 後からtag変更
|
72
|
+
#tree.item(id[1], tags="")
|
73
|
+
|
74
|
+
# 全id取得
|
70
75
|
#print(tree.get_children())
|
71
76
|
|
72
77
|
win.mainloop()
|
1
追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
Treeviewの指定行の背景色と文字色を変更したいです。
|
2
2
|
[tkinter ttk treeview色付きの行](https://www.it-swarm-ja.tech/ja/python/tkinter-ttk-treeview%E8%89%B2%E4%BB%98%E3%81%8D%E3%81%AE%E8%A1%8C/815083360/)
|
3
3
|
を参考に文字色の色を設定できましたが、背景色が変更できていません。
|
4
|
+
(行クリック時の選択状態のときは別の色にしたいです。)
|
4
5
|
|
5
6
|
また、あとから指定行の色を変更したい場合はどうすればいいですか。
|
6
7
|
例えば、```ddd,eee,fff``` を青色から緑色に変更する。
|