IGUIWindow Weirdness

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
inbuninbu
Posts: 8
Joined: Mon Feb 05, 2007 12:12 am

IGUIWindow Weirdness

Post by inbuninbu »

Hi, I've started to play with the gui part of irrlicht, starting from the tutorial, but I have come across a strange problem.

The quit button works fine. However, if I click on the button to open a window, the widget does not depress, no window appears, *and* it breaks the quit button, which will from then on not depress either.

This is the real kicker. Simply having a pointer to an IGUIWindow will break it. However, addFileOpenDialog() works fine.

I'm running 1.2 on Linux. The example compiles and runs fine. But this makes no sense to me.

Code: Select all

class EventReceiver : public IEventReceiver
{
  public:
    virtual bool OnEvent(SEvent event)
    {
      if (event.EventType == EET_GUI_EVENT)
      {
        s32 id = event.GUIEvent.Caller->getID();
        IGUIEnvironment* env = device->getGUIEnvironment();
        //IGUIWindow* window;  //breaks
        switch(event.GUIEvent.EventType)
        {
          case EGET_BUTTON_CLICKED:
            switch(id)
            {
              case 101:
                device->closeDevice();
                return true;
                break;
              case 102:
                //env->addFileOpenDialog(L"Please choose a file."); // works
                //IGUIWindow* window;  // breaks
                //env->addWindow( rect<s32>(100, 100, 300, 200), false, L"Test window"); // breaks
                return true;
                break;
            }
            break;
        }
        return false;
      }
    }
};
Thanks in advance!
inbuninbu
Posts: 8
Joined: Mon Feb 05, 2007 12:12 am

Solved

Post by inbuninbu »

Sorry, I finally figured out that my control statements were screwed up.
Post Reply