Re: Programmatically show NSPopUpButton menu?
Re: Programmatically show NSPopUpButton menu?
- Subject: Re: Programmatically show NSPopUpButton menu?
- From: Uli Kusterer <email@hidden>
- Date: Sat, 28 Oct 2006 11:40:16 +0200
Am 27.10.2006 um 00:06 schrieb Jerry Krinock:
on 06/10/26 16:46, Keith Blount at email@hidden wrote:
I would like to bring up the menu of an NSPopUpButton
programmatically - ie.
without the user having to click on the button itself. This may
sound strange,
I was thinking of doing the same thing, but for a main menu. I
haven't
gotten around to trying it yet, but I read in the list archives
that, in
general, to make simulated mouse clicks, you find the (x,y)
location of the
control you want to click, and then feed this location to
CGEventCreateMouseEvent. Give it a try and let me know if it works!
While you're at it, make sure you also test it in cases where the
thing to be clicked is covered by another window, or the application
is hidden. Wouldn't want to accidentally hit the "yes" button of a
"really empty trash" panel that's on the screen.
Cheers,
-- M. Uli Kusterer
http://www.zathras.de
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden