About Store Forum Documentation Contact
Donations:
140$/mo



Post Reply 
Wrong parameter in button callback function
Author Message
Harton Offline
Member

Post: #1
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
Visit this user's website Find all posts by this user Quote this message in a reply
Harton Offline
Member

Post: #2
RE: Wrong parameter in button callback function
Anyone knows how to fix it?
10-24-2011 03:28 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Harton Offline
Member

Post: #3
RE: Wrong parameter in button callback function
Before calling the load function
10-25-2011 12:17 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Harton Offline
Member

Post: #4
RE: Wrong parameter in button callback function
Hello! pfft
Tell me, the error is on my side or the engine? This is very important for me. smile
10-28-2011 04:41 PM
Visit this user's website Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #5
RE: Wrong parameter in button callback function
Your code works for me..
10-28-2011 05:28 PM
Find all posts by this user Quote this message in a reply
khces Offline
Member

Post: #6
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
Find all posts by this user Quote this message in a reply
Harton Offline
Member

Post: #7
RE: Wrong parameter in button callback function
Thanks!
11-07-2011 03:08 AM
Visit this user's website Find all posts by this user Quote this message in a reply
Driklyn Offline
Member

Post: #8
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
Find all posts by this user Quote this message in a reply
Post Reply