summaryrefslogtreecommitdiff
path: root/iup/src/mot/iupmot_tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'iup/src/mot/iupmot_tree.c')
-rwxr-xr-xiup/src/mot/iupmot_tree.c14
1 files changed, 7 insertions, 7 deletions
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)