Problems calling a method on the controller from outside the controller

Hello,



I have the following method:

[java]

public void receivedText(String text, NiftyImage icon) {

chatLineCounter++;

logger.debug("adding message " + chatLineCounter + " to screen");

CustomControlCreator createChatLine = new CustomControlCreator("chat-line-" + chatLineCounter,

"chat-line-control");

createChatLine.create(nifty, screen, element.findElementByName("chat-panel"));

Element el = element.findElementByName("chat-line-" + chatLineCounter);

el.findElementByName("chat-line-text").getRenderer(TextRenderer.class).setText(text);

el.findElementByName("chat-line-icon").getRenderer(ImageRenderer.class).setImage(icon);



element.getParent().setLayoutManager(new VerticalLayout());

element.getParent().layoutElements();

}

[/java]



with this method I add lines to a scollable panel. When I call this method from another method in the same controller, everything works like a charm. When I call it from outside the controller, Nifty just hangs after exiting this method.



Any ideas? Am I doing something wrong here?

NM. It’s an error somewhere else. Somewhere in my own code, which I can’t figure out (yet).

ah, found it…



Forgot to call a method on my listener which the other class was waiting on. This caused a timeour which crashed my game…