Image Buttons

Forum for general chit-chat or off-topic discussion.

Moderators: CEGUI MVP, CEGUI Team

E.Kiver
Just popping in
Just popping in
Posts: 12
Joined: Tue Oct 09, 2007 18:56

Image Buttons

Postby E.Kiver » Wed Oct 10, 2007 20:31

I've read "Create ImageButtons" article http://www.cegui.org.uk/wiki/index.php/ ... ageButtons
but I cannot access source files because of invalid link.
So my question is: How to subscribe event to ImageButton?
this is part of my GUI.layout
<Window Type="DefaultGUISheet" Name="root">
<Window Type="DefaultGUISheet" Name="GameGUI">
<Property Name="UnifiedSize" Value="{{1,0},{1,0}}" />

<Window Type="TaharezLook/ImageButton" Name="GameGui/btnNewGame">

and in my programm I call

CEGUI::WindowManager& wmgr = CEGUI::WindowManager::getSingleton();
wmgr.getWindow((CEGUI::utf8*)"GameGUI/btnNewGame")
->subscribeEvent(
CEGUI::PushButton::EventClicked,
CEGUI::Event::Subscriber(&IntroState::GUIQuitGame, this));

and then I get an exception(without subscribing I see my button and it is also reacts on dragover and such events). I guess it is caused by

CEGUI::PushButton::EventClicked

maybe I'm wrong but my button is ImageButton rather than Button so I cannot use PushButton class of CEGUI

Once again, how to subscribe event to ImageButton?

E.Kiver
Just popping in
Just popping in
Posts: 12
Joined: Tue Oct 09, 2007 18:56

Reply

Postby E.Kiver » Wed Oct 10, 2007 21:08

I’ve solve it. Was reading TaharezLookSkin.scheme for ImageButton and figured that it IS PushButton but with different graphical representation. So I’ve checked my Layout angain and noticed that my button was declared as GameGui\btnNewGame and in the game I was trying to reach GameGUI\btnNewGame.
Sorry for nonsence post.

Pompei2
Home away from home
Home away from home
Posts: 489
Joined: Tue May 23, 2006 16:31

Postby Pompei2 » Mon Oct 22, 2007 10:44

Your post has sense, now i know that the links are broken ....... shit :)
And to detect such bugs, you should enclose EVERY block that calls cegui functions with a try/catch mechanism, as such "crashs" will happen often to you ! also always look into CEGUI.log, often there is something to help you.


Return to “Offtopic Discussion”

Who is online

Users browsing this forum: No registered users and 3 guests