diff options
author | fvogel <fvogelnew1@free.fr> | 2019-05-26 19:06:03 (GMT) |
---|---|---|
committer | fvogel <fvogelnew1@free.fr> | 2019-05-26 19:06:03 (GMT) |
commit | 075c8c77b5d81bbd425891f8b107b647a6f85254 (patch) | |
tree | 33513fcb29cb076b3f9db638c4a9ef15e1020856 /generic/ttk | |
parent | 089077e09c48fcdea6f2d483ecd338ee2bde0552 (diff) | |
parent | 984945146cd760e799a6684917573e4f1175ef08 (diff) | |
download | tk-075c8c77b5d81bbd425891f8b107b647a6f85254.zip tk-075c8c77b5d81bbd425891f8b107b647a6f85254.tar.gz tk-075c8c77b5d81bbd425891f8b107b647a6f85254.tar.bz2 |
Fix [2a6c62afd9] - <<TreeviewSelect>> does not fire on item delete
Diffstat (limited to 'generic/ttk')
-rw-r--r-- | generic/ttk/ttkTreeview.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c index 64e25aa..daee5db 100644 --- a/generic/ttk/ttkTreeview.c +++ b/generic/ttk/ttkTreeview.c @@ -2682,7 +2682,7 @@ static int TreeviewDeleteCommand( { Treeview *tv = recordPtr; TreeItem **items, *delq; - int i; + int i, selItemDeleted = 0; if (objc != 3) { Tcl_WrongNumArgs(interp, 2, objv, "items"); @@ -2709,6 +2709,9 @@ static int TreeviewDeleteCommand( */ delq = 0; for (i=0; items[i]; ++i) { + if (items[i]->state & TTK_STATE_SELECTED) { + selItemDeleted = 1; + } delq = DeleteItems(items[i], delq); } @@ -2725,6 +2728,9 @@ static int TreeviewDeleteCommand( } ckfree(items); + if (selItemDeleted) { + TtkSendVirtualEvent(tv->core.tkwin, "TreeviewSelect"); + } TtkRedisplayWidget(&tv->core); return TCL_OK; } |