p2 wrote:
} Hi
}
} My agent application will not automatically respond mouse movement.
} Please suggest if there any property.
}
} that is ...Select a menu bar item, like "File", "Date and Time",
} etc... it will automatically pop up menu.
} BUT when cursor moves over my application, it is not poping up menu.
}
} P2
}
Are you writing a Cocoa application? For this kind of action to happen,
your application's front window has to be active and set to accept mouse-
moved events ( send the the window, e.g., myWindow the message [myWindow
setAcceptsMouseMovedEvents:YES] ). Then, the NSView object that
generates the menu has to be subclassed by you and include an override
for the mouseMoved: message). This NSView subclass must also contain a
menuForEvent: method to generate the menu.
Once the mouseMoved: method detects the menu position, it will send a
message that would look something like
[NSMenu popUpContextMenu:aMenu withEvent:anEvent forView:self]
where anEvent comes directly from the mouseMoved: method's parameter and
aMenu is whatever menu is called-for. However, once the menu becomes
active, it will persist until a selection is made - if you want to allow
the user to track off the menu to make it vanish, you could set a menu
delegate that has the method
- (void)menu:(NSMenu *)aMenu willHighlightItem:(NSMenuItem *)anItem
if anItem is nil, the user may have tracked off the menu (unless it has
disabled items or spacer lines) and you will want to send [aMenu
cancelTracking] to make the menu go away and restore focus to the
original NSView object.
HTH