Updating menus (was Re: Clipboard madness)

Richard Gaskin ambassador at fourthworld.com
Thu Sep 22 22:18:53 EDT 2005


Jeanne A. E. DeVoto wrote:
> At 1:22 PM -0700 9/22/2005, Richard Gaskin wrote:
> 
>> But if the user has text on the Clipboard from another app, how does 
>> your app know without something horribly inefficient like polling?
>
> I'd be inclined to just check the clipboard function on mouseDown in the 
> menu bar. That way you only need to update the menu when it's actually 
> displayed. (Of course you'd also need to check the clipboard in the 
> menuPick handler itself, because if the user uses a keyboard equivalent 
> you won't get the mouseDown, but I think that's not a bad idea anyway, 
> just on general principles - it's the last line of defense for error 
> handling in case the clipboard content isn't what you thought it was.)

While that takes care of the menu rendering, it doesn't take care of any 
keyboard shortcuts that a menu might have.

Ken and Xavier's suggestion of using the resume message allows us to do 
both.

I still believe there's an even simpler way to handle that through 
properties alone, but lately I think everything can be reduced to 
property settings so I may just be crazy.....

--
  Richard Gaskin
  Managing Editor, revJournal
  _______________________________________________________
  Rev tips, tutorials and more: http://www.revJournal.com



More information about the use-livecode mailing list