Tonegodgui get mouse values

How do I get the mouse values when my mouse is over an element? I have tried screen.getMouseXY() but when my mouse is over the gui element, no value is returned.

 if(name.equals("RightClick") && Statics.s_ShowInventory == true){
               //mouseFocusElement = getEventElement(screen.getMouseXY().x, screen.getMouseXY().y);

This also doesn’t work. There is nothing printed to the console unless my mouse is not over any gui element

Try to work whit that :

import org.lwjgl.input.Mouse;
Mouse.getX() ;
Mouse.getY() ;

Am using tonegod and this is how i get my mouse position.

Still nothing. This is in the onAction method if that makes a difference.

Well am not totaly sure I underthand then, cause the Mouse.getX() should work at any time. Plus if its printing nothing not even a null then the problem don’t come from the printing itself but befaure.

I know that sometime if inside a enqueud the code won’t send a error message if its not grave enouf to make crash the program. You should check in your code if it have any problem befaure, or if that Statics.s_ShowInventory aint actully false at one point

Removing the Statics.s_showInventory does nothing and still nothing is being returned. I am wondering if I am creating the gui all wrong at this point.

screen = new Screen(main);

How the screen is initialized. I have an inventory element added to screen, and then 40 elements added to the inventory element.

Element e = createInventorySlot(i, x, y);                  
            inventoryElements[i] = e;
            inventorySlots[i] = new InventorySlot(i, 0, "empty");
            e.setToolTipText(inventorySlots[i].itemName + " : " + inventorySlots[i].slotNumber + " : " + inventorySlots[i].quantity);

And then a Window is created here.

win = new Window(screen, Vector2f.ZERO, dim);

Is it possible that the Window or Screen variable is not necessary and is causing the problem?

Never mind this was all fixed by using ButtonAdapters instead of Elements.