質問編集履歴
6
記入もれ
test
CHANGED
File without changes
|
test
CHANGED
@@ -121,6 +121,8 @@
|
|
121
121
|
new_save_bt.grid(row=0, column=2)
|
122
122
|
|
123
123
|
#フレーム設置
|
124
|
+
left_frame.grid(row=0, column=0)
|
125
|
+
right_frame.grid(row=0, column=1)
|
124
126
|
up_frame.grid(row=0, column=0)
|
125
127
|
under_frame.grid(row=1, column=0)
|
126
128
|
|
5
入力ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -78,7 +78,7 @@
|
|
78
78
|
for i, label in enumerate(labels):
|
79
79
|
label.grid(row=i, column=0)
|
80
80
|
|
81
|
-
#各entry
|
81
|
+
#各entry
|
82
82
|
number_entry = tk.Entry(left_frame)
|
83
83
|
title_entry = tk.Entry(left_frame)
|
84
84
|
author_entry = tk.Entry(left_frame)
|
4
入力ミス
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,7 +64,7 @@
|
|
64
64
|
under_frame.columnconfigure(1, weight=1)
|
65
65
|
under_frame.columnconfigure(2, weight=1)
|
66
66
|
|
67
|
-
|
67
|
+
"""left_frame"""
|
68
68
|
#各ラベル
|
69
69
|
number_label = tk.Label(left_frame, text='書誌番号')
|
70
70
|
title_label = tk.Label(left_frame, text='タイトル')
|
3
入力ミスがあったため
test
CHANGED
File without changes
|
test
CHANGED
@@ -64,7 +64,7 @@
|
|
64
64
|
under_frame.columnconfigure(1, weight=1)
|
65
65
|
under_frame.columnconfigure(2, weight=1)
|
66
66
|
|
67
|
-
|
67
|
+
”””left_frame"""
|
68
68
|
#各ラベル
|
69
69
|
number_label = tk.Label(left_frame, text='書誌番号')
|
70
70
|
title_label = tk.Label(left_frame, text='タイトル')
|
2
入力ミスがあったため
test
CHANGED
File without changes
|
test
CHANGED
@@ -47,6 +47,7 @@
|
|
47
47
|
left_frame.rowconfigure(3,weight=1)
|
48
48
|
left_frame.rowconfigure(4,weight=1)
|
49
49
|
left_frame.rowconfigure(5,weight=1)
|
50
|
+
left_frame.rowconfigure(6,weight=1)
|
50
51
|
|
51
52
|
#right_frameのconfigure
|
52
53
|
right_frame.columnconfigure(0, weight=1)
|
@@ -56,6 +57,7 @@
|
|
56
57
|
right_frame.rowconfigure(3, weight=1)
|
57
58
|
right_frame.rowconfigure(4, weight=1)
|
58
59
|
right_frame.rowconfigure(5, weight=1)
|
60
|
+
right_frame.rowconfigure(6, weight=1)
|
59
61
|
|
60
62
|
#under_frameのconfigue
|
61
63
|
under_frame.columnconfigure(0, weight=1)
|
1
コードの細かい不備を修正。質問にある問題以外はない状態にしました。これから教えて頂いた方法を実践予定です。
test
CHANGED
File without changes
|
test
CHANGED
@@ -14,20 +14,20 @@
|
|
14
14
|
### 該当のソースコード
|
15
15
|
|
16
16
|
```Python
|
17
|
-
import tkinter
|
17
|
+
import tkinter as tk
|
18
|
-
import
|
18
|
+
from tkinter import ttk
|
19
|
-
|
19
|
+
|
20
20
|
window = tk.Tk()
|
21
21
|
window.geometry('400x400')
|
22
22
|
window.title('data window')
|
23
23
|
|
24
24
|
#上下フレーム
|
25
|
-
up_frame =
|
25
|
+
up_frame = tk.Frame(window, width=400, height=350)
|
26
|
-
under_frame =
|
26
|
+
under_frame = tk.Frame(window, width=400, height=50)
|
27
27
|
|
28
28
|
#上フレームを左右フレームに分ける
|
29
|
-
left_frame =
|
29
|
+
left_frame = tk.Frame(up_frame, width=200, height=300)
|
30
|
-
right_frame =
|
30
|
+
right_frame = tk.Frame(up_frame, width=200, height=300)
|
31
31
|
|
32
32
|
up_frame.grid_propagate(False)
|
33
33
|
under_frame.grid_propagate(False)
|
@@ -49,14 +49,14 @@
|
|
49
49
|
left_frame.rowconfigure(5,weight=1)
|
50
50
|
|
51
51
|
#right_frameのconfigure
|
52
|
+
right_frame.columnconfigure(0, weight=1)
|
52
53
|
right_frame.rowconfigure(0, weight=1)
|
53
54
|
right_frame.rowconfigure(1, weight=1)
|
54
55
|
right_frame.rowconfigure(2, weight=1)
|
55
56
|
right_frame.rowconfigure(3, weight=1)
|
56
57
|
right_frame.rowconfigure(4, weight=1)
|
57
58
|
right_frame.rowconfigure(5, weight=1)
|
58
|
-
|
59
|
+
|
59
|
-
|
60
60
|
#under_frameのconfigue
|
61
61
|
under_frame.columnconfigure(0, weight=1)
|
62
62
|
under_frame.columnconfigure(1, weight=1)
|
@@ -64,36 +64,36 @@
|
|
64
64
|
|
65
65
|
|
66
66
|
#各ラベル
|
67
|
-
number_label =
|
67
|
+
number_label = tk.Label(left_frame, text='書誌番号')
|
68
|
-
title_label =
|
68
|
+
title_label = tk.Label(left_frame, text='タイトル')
|
69
|
-
author_label =
|
69
|
+
author_label = tk.Label(left_frame, text='著者')
|
70
|
-
time_label =
|
70
|
+
time_label = tk.Label(left_frame, text='出版年')
|
71
|
-
publisher_label =
|
71
|
+
publisher_label = tk.Label(left_frame, text='出版社')
|
72
|
-
type_label =
|
72
|
+
type_label = tk.Label(left_frame, text='形態')
|
73
|
-
janle_label =
|
73
|
+
janle_label = tk.Label(left_frame, text='ジャンル')
|
74
74
|
|
75
75
|
labels = [number_label, title_label, author_label, time_label, publisher_label, type_label, janle_label]
|
76
76
|
for i, label in enumerate(labels):
|
77
77
|
label.grid(row=i, column=0)
|
78
78
|
|
79
79
|
#各entry :
|
80
|
-
number_entry =
|
80
|
+
number_entry = tk.Entry(left_frame)
|
81
|
-
title_entry =
|
81
|
+
title_entry = tk.Entry(left_frame)
|
82
|
-
author_entry =
|
82
|
+
author_entry = tk.Entry(left_frame)
|
83
|
-
time_entry =
|
83
|
+
time_entry = tk.Entry(left_frame)
|
84
|
-
publisher_entry =
|
84
|
+
publisher_entry = tk.Entry(left_frame)
|
85
85
|
|
86
86
|
entrys = [number_entry, title_entry, author_entry, time_entry, publisher_entry]
|
87
87
|
for i, entry in enumerate(entrys):
|
88
88
|
entry.grid(row=i, column=1)
|
89
89
|
|
90
90
|
#combobox
|
91
|
-
type_list =
|
91
|
+
type_list = ['1', '2', '3']
|
92
92
|
type_choice_combo = ttk.Combobox(left_frame, state='readonly', values=type_list)
|
93
93
|
type_choice_combo.current(0)
|
94
94
|
|
95
95
|
#entry
|
96
|
-
janle_entry =
|
96
|
+
janle_entry = tk.Entry(left_frame)
|
97
97
|
|
98
98
|
#combo, entry設置
|
99
99
|
type_choice_combo.grid(column=1, row=5)
|
@@ -102,17 +102,17 @@
|
|
102
102
|
|
103
103
|
"""right_frame"""
|
104
104
|
#上右側:テキストフィールド UI生成・設置・データ反映
|
105
|
-
note_label =
|
105
|
+
note_label = tk.Label(right_frame, text='note')
|
106
106
|
note_label.grid(row=0, column=0)
|
107
107
|
|
108
|
-
note_area =
|
108
|
+
note_area = tk.Text(right_frame)
|
109
109
|
note_area.grid(row=1, column=0, rowspan=6)
|
110
110
|
|
111
111
|
|
112
112
|
#under_frame
|
113
|
-
renew_bt =
|
113
|
+
renew_bt = tk.Button(under_frame, text='データ更新', command=None)
|
114
|
-
delete_bt =
|
114
|
+
delete_bt = tk.Button(under_frame, text='データ削除', command=None)
|
115
|
-
new_save_bt =
|
115
|
+
new_save_bt = tk.Button(under_frame, text='新規作成', command=None)
|
116
116
|
|
117
117
|
renew_bt.grid(row=0, column=0)
|
118
118
|
delete_bt.grid(row=0, column=1)
|
@@ -122,7 +122,7 @@
|
|
122
122
|
up_frame.grid(row=0, column=0)
|
123
123
|
under_frame.grid(row=1, column=0)
|
124
124
|
|
125
|
-
|
125
|
+
window.mainloop()
|
126
126
|
```
|
127
127
|
|
128
128
|
### 試したこと ###
|