Adding Item To Sub-Menu?
-
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?
-
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
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better π
Register LoginAdvertisement