Nifty: strange popup. Does anyone have a *simple*, working code-example?

Hi,
sorry to bother again, but I read http://sourceforge.net/apps/mediawiki/nifty-gui/index.php?title=Popup_Layer_Reference and searched the forum, I still dont understand what I’m doing wrong with nifty-popups:

When I understand it correct…

[java] Element element = nifty.createPopup(“niftyPopup”);
nifty.showPopup(nifty.getCurrentScreen(), element.getId(), null);
[/java]

should search on ‘niftyPopup’-tag in my .xml, where I have:

[java]<nifty xmlns=“http://nifty-gui.sourceforge.net/nifty.xsd” xmlns:xsi=“http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation=“http://nifty-gui.sourceforge.net/nifty.xsd http://nifty-gui.sourceforge.net/nifty.xsd”>

&lt;useStyles filename="nifty-default-styles.xml" /&gt;
&lt;useControls filename="nifty-default-controls.xml" /&gt;
&lt;screen id="start" controller="mygame.Main"&gt;
    &lt;layer id="layer" childLayout="center"&gt;

// …my other screen stuff
</panel>
</layer>
</screen>

<popup id=“xniftyPopupMenu” childLayout=“center”>
<panel height=“50%” width=“50%” childLayout=“vertical” visibleToMouse=“true”>
<panel height=“20%” childLayout=“center” backgroundColor="#f00f" />
<text id=“popup_text0” font=“ui/fonts/palatino.fnt” color="#000f" align=“center” valign=“center” text=“1530”/>
<panel height=“20%” childLayout=“center” backgroundColor="#00ff"/>

        &lt;panel height="30%" childLayout="center" backgroundColor="#ff0f" &gt;
            &lt;image width="10%" height="40%" filename="Textures/fuji_season.tga" imageMode="subImage:0,0,250,150" &gt;
                &lt;interact onClick="onPopUpClick(0)"/&gt;
            &lt;/image&gt;            
        &lt;/panel&gt;  
    &lt;/panel&gt;
&lt;/popup&gt;

</nifty>
[/java]

Sadly ‘something’ shows up, but it has not to do woth what I defined in .xml, nor changes when I changes my xml.
So I guess its not enough to nifty.createPopup(“niftyPopup”) to get the right template, it looks more, like it creates a default one new.

Is there a simple example of popups, sadly even on NiftyGuiDemo I did not find one (and besides NiftyGuiDemo crashes soon after the first start animation.

SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main] java.lang.NoSuchMethodError: de.lessvoid.nifty.controls.TextField.setText(Ljava/lang/String;)V at de.lessvoid.nifty.examples.controls.listbox.ListBoxDialogController.bind(ListBoxDialogController.java:65) ...

Its not the bug, that ‘niftyPopup’ is not ‘xniftyPopupMenu’: I changed that in testing and forgot to change it back before posting :wink:

(wasn’t there before a way to change posted text here?)

Update:
I’m now able to fill the popup with layers, etc. by java-code, but I still don’t understand how to access the popup with my .xml-popup definition.
When I’m right, NiftyGuiDemo only fills popups by code too.
Anyone got popups working with definitions from .xml?

Ok, got it working now somehow.

Thanks for the help.