Sublime Forum

Context Menu with Children

#1

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]
{
“caption”: “Testing”,
“id: testplugin”
“children”:

	{"command": "test1", "caption": "Test 1"},
	{"command": "test2", "caption": "Test 2"}
]

}][/code]

Any help would be greatly appreciated. Thanks!

0 Likes

#2

Ok, I figured out - here’s how:

[code]
{ “caption”: “Testing”, “id”: “file”, “children”:

	{"command": "test1", "caption": "Test 1"},
	{"command": "test2", "caption": "Test 2"}
	]
}

][/code]

0 Likes

#3

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]
{ “caption”: “Testing”, “id”: “file”, “children”:

  {"command": "test1", "caption": "Test 1"},
  {"command": "test2", "caption": "Test 2"}
  ]

}
][/code]

0 Likes