contextual menu

thierry douez at
Mon Sep 27 13:14:05 EDT 2004


>> would like to build a contextual menu   ?
>> How is the "usual way" to do it ?

KM> Create a pop-up-menu button with all the"menupick" handlers
KM> you need and move this button OFF screen...
KM> on mouseup quoi
KM>     if quoi = 3 then
KM>        popup btn "your popup button here"
KM>     end if
KM> end mouseup
KM> will popup that button when the right mouse-button is clicked
KM> = control-click on a mac...

Next story: in the field script i put this script below to prepare
the contextual menu : i want to know the word of the word before
the click position ! this works great when i click on a word, but do
nothing when clicking on an empty place....
in fact the clickchunk returns nothing !!!! How can i work around ?

on mousedown
  select the clickchunk
  put the value of the clickline into Txt
  put char offset( Txt, me ) to ( word 4 of the clickchunk ) of me into Txt
  put word -2 of Txt into lTheMode
  if the last char of lTheMode is ":" then
  delete the last char of lTheMode
  put "????" into lTheMode
  end if
end mousedown

Thanks and regards, thierry

More information about the use-livecode mailing list