Welcome to Soft32 Forums!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Agent application will not pop up menu on mouse movement

 
   Soft32 Home -> Mac -> Programmer Help RSS
Next:  *****Language Institutes *******  
Author Message
p2

External


Since: May 19, 2007
Posts: 9



(Msg. 1) Posted: Tue Aug 25, 2009 11:51 pm
Post subject: Agent application will not pop up menu on mouse movement
Archived from groups: comp>sys>mac>programmer>help (more info?)

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
Back to top
Login to vote
Luddite Wacko

External


Since: Nov 24, 2008
Posts: 15



(Msg. 2) Posted: Sat Aug 29, 2009 3:03 pm
Post subject: Re: Agent application will not pop up menu on mouse movement [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

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
Back to top
Login to vote
Display posts from previous:   
Related Topics:
tracking mouse movement.. - Hi there, I have a Cocoa GUI application with a button & edit box. When I launch this application, when i move the...

Restricting Mouse Movement...possible? - Hi...I'm writing a game (in straight-C, Carbon, CW8, meant for OS9 and OSX). When the game starts, the mouse (cursor) i...

How to create an "Agent Application"? - I'm trying to create a daemon for Mac OS X. Apple documentation says "If you need to provide user-specific servic...

How to change an application "menu" name - Hi, I'm wondering how to change the name that an application places as the title of the left-most menu. It seems to..

localize application menu - Hello, I am sure this must be a FAQ somewhere, but I couldn't find anything. How to dynamically localize the..

cocoa application build from a makefile does not display i.. - I am completly new to macosx dev... I am trying to make my first application with a makefile. The application has onl...
       Soft32 Home -> Mac -> Programmer Help All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum

Categories:
 Windows
 Linux
  Mac
 PDA


[ Contact us | Terms of Service/Privacy Policy ]