summaryrefslogtreecommitdiff
path: root/iup/src/mot/iupmot_tree.c
diff options
context:
space:
mode:
authorNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 02:26:30 +0200
committerNicolas "Pixel" Noble <pixel@nobis-crew.org>2010-09-09 02:32:26 +0200
commit7505e88db66798b2b8fcdff2d92a7136cd826b5b (patch)
treeb6ced565318f8e8112e35cb0ad53abe4212ef8de /iup/src/mot/iupmot_tree.c
parente9a184546b18cf3b796bd560561f312934004c54 (diff)
Upgrading to IUP 3.2 - and cleaning up.
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)