[mozbr-desenvolvimento] dúvida - programação em XUL

Fernando Pereira Silveira fernandopsilveira em yahoo.com.br
Quinta Março 29 18:28:22 BRT 2007


Olá pessoal!

Alguém aqui programa em XUL?
Estou com um problema ao lidar com um viewer (interface nsITreeView) 
personalizado de uma árvore (elemento tree).

O problema aparentemente é bem simples: dentro do viewer do elemento 
tree eu criei algumas funções além das funções habituais (getCellText, 
isSeparator, setTree, etc), como adicionarItem e removerItem.

Eu criei essas funções dentro do viewer por opção pessoal. Talvez elas 
pudessem ser criadas fora do viewer.

O problema é que não consigo acessar essas funções, apenas as funções 
habituais. Por exemplo, se tento acessar a função 
arvore.view.removerItem(), o console de erros reclama que isso não é uma 
função. Mas se tentar acessar arvore.view.getCellText(linha, coluna), 
não há problema algum.

Alguém pode me ajudar? Estou testando o código no Firefox 2 (2.0.0.3).

O código é mais ou menos o seguinte:

function iniciar() {
	var arvore = document.getElementById("avancado-arvore");
	var itens = new Array("1", "2", "3");

	arvore.view = new Tree(itens);
}

function Tree(itens) {
	this.itens = itens;
}

Tree.prototype = {
	adicionarItem: function(novo) {
		(...)
	},

	removerItem: function() {
		(...)
	},

	getCellText: function(linha, coluna) {
		(...)
	},

	get rowCount(){ return this.itens.length; },
	getCellProperties: function(linha,coluna,props){},
	getColumnProperties: function(colid,coluna,props){},
	getImageSrc: function(linha,coluna){ return null; },
	getRowProperties: function(linha,props){},
	isContainer: function(linha){ return false; },
	isSeparator: function(linha){ return false; },
	isSorted: function(){ return false; },
	setTree: function(treebox){ this.treebox = treebox; }
}


		
_______________________________________________________ 
Yahoo! Mail - Sempre a melhor opção para você! 
Experimente já e veja as novidades. 
http://br.yahoo.com/mailbeta/tudonovo/


Mais detalhes sobre a lista de discussão mozbr-desenvolvimento