ā03-26-2008 11:53 AM
ā03-26-2008 12:01 PM
ā03-26-2008 12:03 PM
I seem to understand that you have 20 rows of controls, and getting the row number can be enough for you. If this is the case, you can pass the row number this way:
SetCtrlAttribute (pHandle, ConfirmID[i-1], ATTR_CALLBACK_DATA, (void *)i);
and retrieve it in button callback simply casting callbackData parameter to an int:
row = (int)callbackData;
Consider also that you can set the callbackData within InstallCtrlCallback function:
InstallCtrlCallback (pHandle, ConfirmID[i-1], psConfirmButtons, (void *)i);
ā03-26-2008 12:12 PM
Thanks to both of you for your response.
I guess I'm still confused. If variable "i" is local to the function drawing the control during program initialization, won't "i" go away after the function is done? I'm thinking that any callback data will point to where "i" was, and cause some kind of addressing error?
ā03-26-2008 12:25 PM
ā03-26-2008 12:33 PM
OK, I think I got it. So the actual value of "i" when the button is generated is saved (as a constant value) and passed to the callback when the appropriate button is pressed.
Thanks, I think that will do it.
DOug