Setting StaticImage Clicked Handler in XML

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

ncoppola
Just popping in
Just popping in
Posts: 3
Joined: Mon Aug 17, 2009 19:40

Setting StaticImage Clicked Handler in XML

Postby ncoppola » Mon Sep 14, 2009 19:09

Hi,

I'm currently trying to create a splash page that will advance to the main screen when clicked. I currently have a static image with 2 children, a static text and a button (don't want the button). In the code I was able to use splashimage->subscribeEvent( CEGUI::Window::EventMouseClick, &HandlerFunction) to make the splash go away on a click, but I want to subscribe that in the layout xml instead of the code. I have a lua function that hides the splash and brings up the main page. I tried using <Event Name="Clicked" Function="Splash_Clicked" /> (Splash_Clicked is the Lua function) in the splash image's definition in the layout, but nothing happens when I click on the screen. If I use that same xml line in the definition of the button, clicking the button will call the function.

The static image can obviously do something on a clicked event, because it works in the code. Does this have to do with how the xml is parsed?

Thanks,
Nick

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Setting StaticImage Clicked Handler in XML

Postby CrazyEddie » Mon Sep 14, 2009 21:00

Hi,

Unfortunately I do not have an answer for you at the moment; another very odd issue :) From a technical standpoint, all window types are treated exactly the same as far as events and xml parsing go. Is there anything in the CEGUI.log file at all that might indicate a problem when you try the subscription to the lua event handler?

CE.

ncoppola
Just popping in
Just popping in
Posts: 3
Joined: Mon Aug 17, 2009 19:40

Re: Setting StaticImage Clicked Handler in XML

Postby ncoppola » Thu Sep 17, 2009 14:17

Looked through the log file after running it with the subscription in the splash image's definition. There's no error when loading the splash layout file. It logs a success.

Sorry for the late response, this is what happens when you only work twice a week.

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: Setting StaticImage Clicked Handler in XML

Postby CrazyEddie » Thu Sep 17, 2009 19:00

Are there any other windows in the splash layout at all? Perhaps the 'click' is going to the wrong window? If you're uncertain, post the layout and we'll be able to see for sure :)

CE.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 1 guest