Additionally, If I remove the panel tag, the button registers events correctly, but it only shows the first control or element placed within the control definition tag, so in this example only the text shows and the image doesn’t appear at all.
My guess would be that the panel is grabbing the mouse event since you set visibleToMouse true on it. Especially since removing it fixes the problem. Once a nifty component accepts the event it doesn’t propagate to its children.
I tried every combination of visibleToMouse="true" with the controlDefinition, the panel, and control and it still doesn’t seem to make a difference
No matter what I’ve tried, adding a panel to the control definition so I can organize the elements and see both prevents the control from being clickable.
It will still hide the text if I try to remove the text from the control definition, and instead add the text per-control like this
Then my only other guess is that adding that panel is doing something funky and the controller for the image changes. You could attach the nifty source and step through it to see whats going on. I usually look through the source pretty heavily when nifty doesn’t do what I think it should be.
It seems like it had something to do with the image tag or how I’m using it, although I can’t quite figure out what. I ran into the problem again trying to register a NiftyMouseMovedEvent with a panel that contained an image (not using a control definition) and it was only registering the event along the edges of the panel (as if the image was blocking the panel).
I just got rid of the image tag and it’s working perfectly, from now on I’m going just use the backgroundImage attribute on panels instead.