summaryrefslogtreecommitdiffstats
path: root/generic/ttk
diff options
context:
space:
mode:
authorfvogel <fvogelnew1@free.fr>2019-05-26 19:05:50 (GMT)
committerfvogel <fvogelnew1@free.fr>2019-05-26 19:05:50 (GMT)
commit984945146cd760e799a6684917573e4f1175ef08 (patch)
treed48f09f1b0c2ce01038a072ab9bd5aa0f5eba865 /generic/ttk
parentaea299e392c37984bf1ded9e99b1299c559ff9cb (diff)
parent8c5a966d5ac524f8ea4bef800ee15309123dae45 (diff)
downloadtk-984945146cd760e799a6684917573e4f1175ef08.zip
tk-984945146cd760e799a6684917573e4f1175ef08.tar.gz
tk-984945146cd760e799a6684917573e4f1175ef08.tar.bz2
Fix [2a6c62afd9] - <<TreeviewSelect>> does not fire on item delete
Diffstat (limited to 'generic/ttk')
-rw-r--r--generic/ttk/ttkTreeview.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/generic/ttk/ttkTreeview.c b/generic/ttk/ttkTreeview.c
index d78df5f..55ee8e0 100644
--- a/generic/ttk/ttkTreeview.c
+++ b/generic/ttk/ttkTreeview.c
@@ -2684,7 +2684,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");
@@ -2711,6 +2711,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);
}
@@ -2727,6 +2730,9 @@ static int TreeviewDeleteCommand(
}
ckfree(items);
+ if (selItemDeleted) {
+ TtkSendVirtualEvent(tv->core.tkwin, "TreeviewSelect");
+ }
TtkRedisplayWidget(&tv->core);
return TCL_OK;
}