Hello!
I have an array of buttons, and I'd like to catch some values of these buttons when I click on them.
And I'd like to change these values sometimes so they are not static.
I've looked in the properties list of a the button class(http://cegui.org.uk/static/WindowsLookProperties.html#ID) to find something like "value" for the buttons, but it seems that it doesn't exist.
Is their a good mean to give a value (let say an int or a float) for each button?
Thanx for your help
Set a value for a Button
Moderators: CEGUI MVP, CEGUI Team
Re: Set a value for a Button
There are many different ways you can approach this.
Normally, I think that people use the Window::setUserData() / Window::getUserData() approach.
If you really want to use a Property you can create your own Property object and add a property to a class via the Window::addProperty() method.
As an alternative approach you could create your own hashtable to store a key:value pair, using the object pointer as the key.
HTH
Normally, I think that people use the Window::setUserData() / Window::getUserData() approach.
If you really want to use a Property you can create your own Property object and add a property to a class via the Window::addProperty() method.
As an alternative approach you could create your own hashtable to store a key:value pair, using the object pointer as the key.
HTH
If somebody helps you by replying to your thread, upvote him/her as a thanks! Make sure to include your CEGUI.log and everything you tried when posting! And remember that we are not magicians!
Re: Set a value for a Button
Thanx Jamarr, it works perfectly with Window::setUserData() / Window::getUserData() !
P.S. I can't find the "solved" button?
P.S. I can't find the "solved" button?
Who is online
Users browsing this forum: No registered users and 8 guests