From 7505e88db66798b2b8fcdff2d92a7136cd826b5b Mon Sep 17 00:00:00 2001 From: "Nicolas \"Pixel\" Noble" Date: Thu, 9 Sep 2010 02:26:30 +0200 Subject: Upgrading to IUP 3.2 - and cleaning up. --- iup/src/mot/iupmot_tree.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'iup/src/mot/iupmot_tree.c') diff --git a/iup/src/mot/iupmot_tree.c b/iup/src/mot/iupmot_tree.c index fa5ef09..0156974 100755 --- a/iup/src/mot/iupmot_tree.c +++ b/iup/src/mot/iupmot_tree.c @@ -1440,7 +1440,7 @@ static int motTreeSetDelNodeAttrib(Ihandle* ih, const char* name_id, const char* else if(iupStrEqualNoCase(value, "MARKED")) /* Delete the array of marked nodes */ { int i; - for(i = 1; i < ih->data->node_count; /* increment only if not removed */) + for(i = 0; i < ih->data->node_count; /* increment only if not removed */) { if (motTreeIsNodeSelected(ih->data->node_cache[i].node_handle)) motTreeRemoveNode(ih, ih->data->node_cache[i].node_handle, 1, 1); @@ -1770,13 +1770,13 @@ static int motTreeConvertXYToPos(Ihandle* ih, int x, int y) static void motTreeCallRightClickCb(Ihandle* ih, int x, int y) { - IFni cbRightClick = (IFni)IupGetCallback(ih, "RIGHTCLICK_CB"); - if (cbRightClick) + Widget wItem = XmObjectAtPoint(ih->handle, (Position)x, (Position)y); + if (wItem) { - int id = motTreeConvertXYToPos(ih, x, y); - if (id != -1) - cbRightClick(ih, id); - } + IFni cbRightClick = (IFni)IupGetCallback(ih, "RIGHTCLICK_CB"); + if (cbRightClick) + cbRightClick(ih, iupTreeFindNodeId(ih, wItem)); + } } static void motTreeCallRenameCb(Ihandle* ih) -- cgit v1.2.3