Page 1 of 1

pop-up menu on mouse right button click

Posted: Thu Apr 27, 2006 3:27 pm
by lbtony
I'm thinking to use a pulldown button and hide it so I put something in my stack script or card script like:

on mouseUp
set the visibility of the pulldown button to true
......
end mouseUp

but my question is, how can I bring the pulldown menu to the proper position(not the mouse loc)?

is there any better way of doing it??
Thank you...

Re: pop-up menu on mouse right button click

Posted: Thu Apr 27, 2006 5:11 pm
by Janschenkel
A better option is to put your opup menu button somewhere off-screen, and then use a script like:

Code: Select all

on mouseUp pMouseButton
  if pMouseButton = 3 then 
    popup button "MyPopupButton" at the clickLoc
  else
    -- do other stuff here
  end if
end mouseUp
The popup menu button will receive the 'menuPick' message when the user picks one of the items, so you'll have to move some of your logic into that menu button as well:

Code: Select all

on menuPick pItem
  switch pItem
    case "Hello world"
      answer "Hello, world!"
      break
    case "Foo"
      answer "Bar" with "Cancel"
      break
    -- more case statements here
  end switch
end menuPick
Hope this helped,

Jan Schenkel.