回答編集履歴
3
Update
test
CHANGED
@@ -9,3 +9,38 @@
|
|
9
9
|
self.correct_widget()
|
10
10
|
master.grab_set()
|
11
11
|
```
|
12
|
+
|
13
|
+
**追記**
|
14
|
+
|
15
|
+
`StringVar()` を使います。以下、変更部分だけを記載します。
|
16
|
+
```python
|
17
|
+
class SubWindow(tkm.Frame):
|
18
|
+
|
19
|
+
#修正画面表示
|
20
|
+
def onDuble(self, event):
|
21
|
+
self.subwindow.append(tkm.Toplevel(highlightthickness=5, highlightbackground="white", highlightcolor="red"))
|
22
|
+
self.CorrectWindow.append(CorrectWindow(self.subwindow[len(self.subwindow)-1],len(self.subwindow)))
|
23
|
+
self.set_correct_data()
|
24
|
+
|
25
|
+
#-----------修正データ読込-START----------
|
26
|
+
def set_correct_data(self):
|
27
|
+
selected_item = self.tree.selection()[0] #選択した行取得
|
28
|
+
values_0 = selected_item # 値の取得(行取得)
|
29
|
+
for i, j in zip([*range(4), *range(5, 9)], [0, *range(2, 9)]):
|
30
|
+
self.CorrectWindow[0].entry_contents[i].set(self.tree.item(selected_item)['values'][j])
|
31
|
+
|
32
|
+
class CorrectWindow(tkm.Frame):
|
33
|
+
|
34
|
+
def correct_widget(self):
|
35
|
+
|
36
|
+
self.entry_contents = [StringVar() for _ in range(9)]
|
37
|
+
self.correct_entry00 = ttk.Entry(self.master, justify=tkm.LEFT, width=13, textvariable=self.entry_contents[0])
|
38
|
+
self.correct_entry01 = ttk.Entry(self.master, justify=tkm.LEFT, width=13, textvariable=self.entry_contents[1])
|
39
|
+
self.correct_combo02 = ttk.Combobox(self.master, justify=tkm.CENTER, width=13, textvariable=self.entry_contents[2])
|
40
|
+
self.correct_combo03 = ttk.Combobox(self.master, justify=tkm.CENTER, width=16, textvariable=self.entry_contents[3])
|
41
|
+
self.correct_date04 = DateEntry(self.master, date_pattern='yyyy/mm/dd', width=13, textvariable=self.entry_contents[4])
|
42
|
+
self.correct_entry05 = ttk.Entry(self.master, justify = tkm.LEFT, width = 13, textvariable=self.entry_contents[5])
|
43
|
+
self.correct_entry06 = ttk.Entry(self.master, justify=tkm.LEFT, width=5, textvariable=self.entry_contents[6])
|
44
|
+
self.correct_entry07 = ttk.Entry(self.master, justify=tkm.LEFT, width=60, textvariable=self.entry_contents[7])
|
45
|
+
self.correct_entry08 = ttk.Entry(self.master, justify=tkm.RIGHT, width=13, textvariable=self.entry_contents[8])
|
46
|
+
```
|
2
Update
test
CHANGED
@@ -1,8 +1,11 @@
|
|
1
|
+
`self.correct_widget()` と `master.grab_set()` の順序を入れ替えて下さい。
|
1
2
|
```python
|
2
|
-
|
3
|
+
class CorrectWindow(tkm.Frame):
|
3
|
-
def
|
4
|
+
def __init__(self,master,num):
|
5
|
+
super().__init__(master)
|
6
|
+
self.pack()
|
7
|
+
master.geometry("550x250+500+350")
|
8
|
+
master.title("修正画面")
|
4
|
-
|
9
|
+
self.correct_widget()
|
5
|
-
# result = self.data[self.data[self.search_col].str.contains(keyword, na=False)]
|
6
|
-
result = self.data[self.data[self.colname_list].apply(lambda r: r.str.contains(keyword, na=False).any(), axis=1)]
|
7
|
-
|
10
|
+
master.grab_set()
|
8
11
|
```
|
1
Update
test
CHANGED
@@ -3,6 +3,6 @@
|
|
3
3
|
def search(self, event=None):
|
4
4
|
keyword = self.keyword.get()
|
5
5
|
# result = self.data[self.data[self.search_col].str.contains(keyword, na=False)]
|
6
|
-
result = self.data[self.data.apply(lambda r: r.str.contains(keyword, na=False).any(), axis=1)]
|
6
|
+
result = self.data[self.data[self.colname_list].apply(lambda r: r.str.contains(keyword, na=False).any(), axis=1)]
|
7
7
|
self.update_tree_by_search_result(result)
|
8
8
|
```
|