• Login
sketchucation logo sketchucation
  • Login
🤑 SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

Adding Item To Sub-Menu?

Scheduled Pinned Locked Moved Developers' Forum
2 Posts 2 Posters 151 Views 2 Watching
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    Physicsguy1
    last edited by 30 Jun 2009, 05:37

    I have a sub menu that contains my W.I.P plugins. I have trouble adding items to it. I can't find the code that does it in the API Index. How do I do this?

    1 Reply Last reply Reply Quote 0
    • C Offline
      Chris Fullmer
      last edited by 30 Jun 2009, 07:16

      http://code.google.com/apis/sketchup/docs/ourdoc/menu.html#add_submenu

      plugins_menu = UI.menu("Plugins") submenu = plugins_menu.add_submenu("Test") submenu.add_item("Plugin Name") { plugin_method }

      That should do the trick.

      It gets a little trickier if you want to multiple different plugins to the same sub-menu, but its possible. I use a global variable, but Jim showed me a way to do it without the global.

      Chris

      Lately you've been tan, suspicious for the winter.
      All my Plugins I've written

      1 Reply Last reply Reply Quote 0
      • 1 / 1
      1 / 1
      • First post
        2/2
        Last post
      Buy SketchPlus
      Buy SUbD
      Buy WrapR
      Buy eBook
      Buy Modelur
      Buy Vertex Tools
      Buy SketchCuisine
      Buy FormFonts

      Advertisement