Skip to content

Commit

Permalink
Bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
davidhozic committed Feb 1, 2024
1 parent d0bf7f8 commit b16bcc5
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
7 changes: 7 additions & 0 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ Glossary
Releases
---------------------

v1.4.7
===================
- Fixed incorrect item being removed (at incorrect index) when editing an object.
- Fixed :class:`tkclasswiz.storage.ListBoxObjects` still selecting the old value when a new value
was inserted. Now only the added value is selected.


v1.4.6
================
- Fixed some parameter name lengths not being accommodated for.
Expand Down
2 changes: 1 addition & 1 deletion tkclasswiz/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
SOFTWARE.
"""

__version__ = "1.4.6"
__version__ = "1.4.7"


from .object_frame import *
Expand Down
9 changes: 6 additions & 3 deletions tkclasswiz/object_frame/frame_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,11 @@ def __init__(
"If editing, the value being edited"

# If return_widget is None, it's a floating display with no return value
editing_index = return_widget.current() if return_widget is not None else -1
if editing_index == -1:
editing_index = None
editing_index = None
if old_data is not None and return_widget is not None:
current = return_widget.current()
if current != -1:
editing_index = current

self.editing_index = editing_index
"The index of object being edited"
Expand Down Expand Up @@ -293,4 +295,5 @@ def _update_ret_widget(self, new: Any):
if isinstance(self.return_widget, ComboBoxObjects):
self.return_widget.current(ind)
else:
self.return_widget.select_clear("0", tk.END)
self.return_widget.selection_set(ind)

0 comments on commit b16bcc5

Please sign in to comment.