Harton
Member
|
Wrong parameter in button callback function
Hello!
I created this class:
Code:
class SaveButton
{
...
void load();
static void saveButtonFunction(int &number);
private:
Button *button;
int idNumber;
};
When I set idNumber for individual class's object and connected this number with saveButtonFunction everything is ok.
Code:
void SaveButton::load()
{
button->func(saveButtonFunction, idNumber);
}
When saveButtonFunction is called, number which is sended, is other than it should be. What is wrong?
|
|
10-21-2011 03:32 PM |
|
Harton
Member
|
RE: Wrong parameter in button callback function
Anyone knows how to fix it?
|
|
10-24-2011 03:28 PM |
|
Harton
Member
|
RE: Wrong parameter in button callback function
Before calling the load function
|
|
10-25-2011 12:17 AM |
|
Driklyn
Member
|
RE: Wrong parameter in button callback function
Your code works for me..
|
|
10-28-2011 05:28 PM |
|
khces
Member
|
RE: Wrong parameter in button callback function
Code:
void SaveButton::load()
{
button->func(saveButtonFunction, (Ptr)idNumber);
}
saveButtonFunction(Ptr number)
{
Int nNumber = (Int)number;
}
[/quote]
|
|
11-06-2011 03:55 PM |
|
Harton
Member
|
RE: Wrong parameter in button callback function
Thanks!
|
|
11-07-2011 03:08 AM |
|
Driklyn
Member
|
RE: Wrong parameter in button callback function
^^ Was going to mention that, but the original code worked for me, so I didn't..
|
|
11-07-2011 08:32 AM |
|