Page 1 of 1

Why do Buttons not work?

Posted: Tue Jun 27, 2017 2:50 pm
by Notion
I added polling for button events to the MastEventController, basically like that:

Code: Select all

        if (event.EventType == EET_GUI_EVENT)
        {
 
            s32 id = event.GUIEvent.Caller->getID();
 
            switch (event.GUIEvent.EventType)
            {
            case EGET_BUTTON_CLICKED:
                if (id == 1)
                {
                    
                }
                break;
 
            }
        }
It wont enter the if block though, couldnt figure out why, do I miss something?

Re: Why do Buttons not work?

Posted: Tue Jun 27, 2017 3:10 pm
by CuteAlien
Depends on which block it won't enter (the id == 1 obviously only works when you got an id with that number).
But most likely reason - you return true in your event-receiver for mouse-events. Which tells Irrlicht that those events are handled by yourself and won't be passed on the GUI at all. Always return false by default in your event-receiver.

Re: Why do Buttons not work?

Posted: Tue Jun 27, 2017 4:25 pm
by Notion
Oh, thanks a lot, that actually was the case, works fine now!