The code below retrieves all the menubutton components on the page and build a tree based on the bound menus.
var nodes = [];
$('.m-btn').each(function(){
var opts = $(this).menubutton('options');
nodes.push({
text: opts.text,
children: $(opts.menu).menu('getItems')
})
});
$('#tt').tree({
checkbox:true,
onlyLeafCheck:true,
data:nodes
});