Handy Script for rearranging menu buttons

Bob Sneidar bobsneidar at iotecdigital.com
Wed Oct 26 16:51:39 EDT 2016


Some have indicated they like to have a development menu in their projects that they remove when compiling to standalone. A better way is to simply hide the development menu then call this handler:

on arrangeMenus tMenu
   -- rearranges the menus based upon their order ignoring invisible menu buttons
   -- tMenu is the name of the menu button group eg. "group MainMenu"
   put the controlNames of tMenu into tControls
   put the left of tMenu into tLeft
   add 4 to tLeft -- default group margin
   
   repeat for each line tControlName in tControls
      if the vis of button ID tControlName is false then next repeat
      set the left of button ID tControlName to tLeft
      put the right of button ID tControlName into tLeft
   end repeat
end arrangeMenus

bobs



More information about the use-livecode mailing list