How to "popup" at a specified coordinate position?

Please note that official support for this menu version has now ceased. There are still plenty of users, though, and the forum is still running. Some of our long-time users may be able to help you out.
Post Reply
gmacfarlane
Beginner
Beginner
Posts: 4
Joined: Mon Dec 30, 2002 11:27 am

How to "popup" at a specified coordinate position?

Post by gmacfarlane »

I am using the popup() function to display a menu, but I would like to be able to control the position of the menu - I am trying to get the popup menu positioned somewhere close to where the mouse is, the "x" coordinate being fixed at "0". Can anyone suggest how I should do this? Here is the sort of thing I have been trying:

Code: Select all

function main_popup(m,x,y)
{  mnu=getMenuByName(m);
    mnu[1]=y;
    mnu[2]=x;
    popup(m);
}
I have tried various attempts to use "setpos()" and "spos()" but this was based largely on guesswork.

popup() does indeed have an optional second parameter which pops the menu up "close" to the current mouse pointer, but this doesn't work for me as the cursor is in a different frame at the time that I want to call popup().

:?: Can anyone suggest how to "popup" at a given coordinate position?

:?: And/or is there a user manual somewhere, which documents the functions (API) ?

Many thanks, in advance.[quote][/quote]
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Hi Graeme,

You posted this a few days ago, so I thought I'd ask if you're still interested, before I post more code. I've been working a little on a library of various positioning functions to go with the menus. It's working pretty well now, and will probably do what you want.

Let me know...

Kevin
gmacfarlane
Beginner
Beginner
Posts: 4
Joined: Mon Dec 30, 2002 11:27 am

Yes please!

Post by gmacfarlane »

Hi Kevin,

Yes please! I am still prototyping so for the time being I had put it to one side (mentally labelled "problem understood, solution pending"), and moved on to other issues.

A library of positioning functions would be most gratefully received.

- Graeme
User avatar
kevin3442
Milonic God
Milonic God
Posts: 2460
Joined: Sat Sep 07, 2002 12:09 am
Location: Lincoln, NE
Contact:

Post by kevin3442 »

Don't know if you're still interested, but if you are, have a look at this message.

Kevin
Post Reply