File tree Expand file tree Collapse file tree 2 files changed +29
-10
lines changed Expand file tree Collapse file tree 2 files changed +29
-10
lines changed Original file line number Diff line number Diff line change 2
2
History
3
3
=======
4
4
5
- 0.1.0 (2019-04-02)
6
- ------------------
5
+ 2022.10.28 -- Bugfix: problem deleting 2 or more keywords
6
+ There was a crash if you deleted a second keyword in the Keywords tab of
7
+ calculation.
7
8
8
- * First release on PyPI.
9
+ 0.1.0 (2019-04-02)
10
+ * First release on PyPI.
Original file line number Diff line number Diff line change @@ -163,8 +163,12 @@ def layout_keywords(self):
163
163
else :
164
164
widgets = d ["widgets" ]
165
165
166
- if "remove" not in widgets :
167
- # The button to remove a row...
166
+ # The button to remove a row...
167
+ if "remove" in widgets :
168
+ widgets ["remove" ].configure (
169
+ command = lambda row = row : self .remove_keyword (row )
170
+ )
171
+ else :
168
172
widgets ["remove" ] = ttk .Button (
169
173
frame ,
170
174
text = "-" ,
@@ -173,7 +177,20 @@ def layout_keywords(self):
173
177
takefocus = True ,
174
178
)
175
179
176
- if "entry" not in widgets :
180
+ if "entry" in widgets :
181
+ widgets ["entry" ].configure (
182
+ validatecommand = (
183
+ self .keyword_cb ,
184
+ keyword ,
185
+ row ,
186
+ "%W" ,
187
+ "%P" ,
188
+ "%s" ,
189
+ "%d" ,
190
+ "%S" ,
191
+ )
192
+ )
193
+ else :
177
194
# the name of the keyword
178
195
widgets ["entry" ] = ttk .Entry (
179
196
frame ,
@@ -192,11 +209,11 @@ def layout_keywords(self):
192
209
takefocus = True ,
193
210
style = "Red.TEntry" ,
194
211
)
195
- widgets ["entry" ].bind (
196
- "<KeyPress-Tab>" ,
197
- lambda event = None , row = row : self .handle_tab (event , row ),
198
- )
199
212
widgets ["entry" ].insert ("end" , keyword )
213
+ widgets ["entry" ].bind (
214
+ "<KeyPress-Tab>" ,
215
+ lambda event = None , row = row : self .handle_tab (event , row ),
216
+ )
200
217
201
218
self .logger .debug (" widgets: " + str (widgets ))
202
219
widgets ["remove" ].grid (row = row , column = 0 , sticky = tk .W )
You can’t perform that action at this time.
0 commit comments