Home Download Buy Blog Forum Support

Context Menu with Children

Context Menu with Children

Postby coldcoder on Mon Feb 04, 2013 1:37 am

I'm new to writing Sublime plugins and want to be able to have a sub menu in the context menu. Here is what I currently have, but it isn't loading anything:

Code: Select all
[
{
   "caption": "Testing",
   "id: testplugin"
   "children":
   [
      {"command": "test1", "caption": "Test 1"},
      {"command": "test2", "caption": "Test 2"}
   ]
}]


Any help would be greatly appreciated. Thanks!
coldcoder
 
Posts: 3
Joined: Mon Feb 04, 2013 1:34 am

Re: Context Menu with Children

Postby coldcoder on Mon Feb 04, 2013 1:50 am

Ok, I figured out - here's how:

Code: Select all
[
   { "caption": "Testing", "id": "file", "children":
      [
      {"command": "test1", "caption": "Test 1"},
      {"command": "test2", "caption": "Test 2"}
      ]
   }
]
coldcoder
 
Posts: 3
Joined: Mon Feb 04, 2013 1:34 am

Re: Context Menu with Children

Postby coldcoder on Mon Feb 04, 2013 2:30 am

Ok, this is now showing the sub menu but all of the options are greyed out even though I have now written the method that will run on each sub child. What am I doing wrong:

Code: Select all
[
   { "caption": "Testing", "id": "file", "children":
      [
      {"command": "test1", "caption": "Test 1"},
      {"command": "test2", "caption": "Test 2"}
      ]
   }
]
coldcoder
 
Posts: 3
Joined: Mon Feb 04, 2013 1:34 am


Return to Plugin Development

Who is online

Users browsing this forum: No registered users and 12 guests