[Solved] Events, buttons etc...

For help with general CEGUI usage:
- Questions about the usage of CEGUI and its features, if not explained in the documentation.
- Problems with the CMAKE configuration or problems occuring during the build process/compilation.
- Errors or unexpected behaviour.

Moderators: CEGUI MVP, CEGUI Team

Tonyx97
Not too shy to talk
Not too shy to talk
Posts: 29
Joined: Sat Sep 12, 2015 20:13

Re: Events, buttons etc...

Postby Tonyx97 » Fri Sep 18, 2015 14:21

Crash:
-1. Start program.
-2. Click on the right listbox.

Valid listbox instance:
-1. Start program.
-2. Click on the left listbox.
-3. You can click on right listbox without crash now, function OnClick will return the instance and everything belonging to the left listbox...

Tonyx97
Not too shy to talk
Not too shy to talk
Posts: 29
Joined: Sat Sep 12, 2015 20:13

Re: Events, buttons etc...

Postby Tonyx97 » Fri Sep 18, 2015 15:12

I've fixed the program just changing the function OnClick like this:

Code: Select all

      bool OnClick(const CEGUI::EventArgs& args)
      {
         const CEGUI::MouseEventArgs& we = static_cast<const CEGUI::MouseEventArgs&>(args);
         CEGUI::String Sender = we.window->getName();
         CEGUI::ItemListbox* CListbox = static_cast<CEGUI::ItemListbox*>(we.window);
         cout << CListbox->getFirstSelectedItem()->getText() << endl;
         return true;
      }


I get correct values finally using this code.


Return to “Help”

Who is online

Users browsing this forum: No registered users and 12 guests