Skip to content

Commit b16bcc5

Browse files
committed
Bug fix
1 parent d0bf7f8 commit b16bcc5

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
lines changed

docs/source/changelog.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,13 @@ Glossary
2424
Releases
2525
---------------------
2626

27+
v1.4.7
28+
===================
29+
- Fixed incorrect item being removed (at incorrect index) when editing an object.
30+
- Fixed :class:`tkclasswiz.storage.ListBoxObjects` still selecting the old value when a new value
31+
was inserted. Now only the added value is selected.
32+
33+
2734
v1.4.6
2835
================
2936
- Fixed some parameter name lengths not being accommodated for.

tkclasswiz/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
SOFTWARE.
2828
"""
2929

30-
__version__ = "1.4.6"
30+
__version__ = "1.4.7"
3131

3232

3333
from .object_frame import *

tkclasswiz/object_frame/frame_base.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,11 @@ def __init__(
8080
"If editing, the value being edited"
8181

8282
# If return_widget is None, it's a floating display with no return value
83-
editing_index = return_widget.current() if return_widget is not None else -1
84-
if editing_index == -1:
85-
editing_index = None
83+
editing_index = None
84+
if old_data is not None and return_widget is not None:
85+
current = return_widget.current()
86+
if current != -1:
87+
editing_index = current
8688

8789
self.editing_index = editing_index
8890
"The index of object being edited"
@@ -293,4 +295,5 @@ def _update_ret_widget(self, new: Any):
293295
if isinstance(self.return_widget, ComboBoxObjects):
294296
self.return_widget.current(ind)
295297
else:
298+
self.return_widget.select_clear("0", tk.END)
296299
self.return_widget.selection_set(ind)

0 commit comments

Comments
 (0)