sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    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

      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
      • Chris FullmerC Offline
        Chris Fullmer
        last edited by

        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
        • First post
          Last post
        Buy SketchPlus
        Buy SUbD
        Buy WrapR
        Buy eBook
        Buy Modelur
        Buy Vertex Tools
        Buy SketchCuisine
        Buy FormFonts

        Advertisement