Hi,
In One of my project i am using Code like this:
Start_Button Callback()
{
Block Processs_Buuton;
;
;
Programming…;
;
;
;
Enable Processs_Buuton;
Pt_CONTINUE;
}
With this above code I am not able to block Process_Button, while
programming. I think reason behind this disabling and enabling button is
under same callback. How to handle like this situations?
Urgent Please…
Thanks,
With Best Regards,
Suresh.
Suresh Kumar <skavula@nordson.com> wrote:
SK > Hi,
SK > In One of my project i am using Code like this:
SK > Start_Button Callback()
SK > {
SK > Block Processs_Buuton;
SK > ;
SK > ;
SK > Programming…;
SK > ;
SK > ;
SK > ;
SK > Enable Processs_Buuton;
SK > Pt_CONTINUE;
SK > }
SK > With this above code I am not able to block Process_Button, while
SK > programming. I think reason behind this disabling and enabling button is
SK > under same callback. How to handle like this situations?
SK > Urgent Please…
SK > Thanks,
SK > With Best Regards,
SK > Suresh.
Are you saying that this callback is somewhat lengthy and that the user
can click on the button additional times while this callback is being
processed?
If I understand your question correctly, I think what your up against
is the fact that resource changes made don’t take effect until after
your program is done with the Photon loop.
Hi ,
Here with i am giving my question more clearly with code for easy
understand.
Code:
int ButtonCallback (PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
*cbinfo)
{
//Create small window from Code, Placed OK button on that window
ApCreateModule (ABM_WINDOW, NULL, cbinfo);
//Disable OK Button from user actions
PtSetResource (ABW_OKBUUTON, Pt_ARG_FLAGS, Pt_TRUE, PT_GHOST |
Pt_SELECTABLE);
//Program Code and it will take minimum one Minute
Programming_Code();
//Enable OK Button for user actions
PtSetResource (ABW_OKBUUTON, Pt_ARG_FLAGS, Pt_FALSE, PT_GHOST |
Pt_SELECTABLE);
}
My aim of above code is while programming, I want to disable OK
Button and after programming I want to make it enable. In my project this
type of situations many. How to handle this type of situations?
Looking forward with this mail,
Thanks,
With Best Regards,
Suresh.
You use PtSetResource to disable the OK button, but this change in resource
will not take effect until your callback routine has returned Pt_CONTINUE.
One way of doing what you want is to arm a timer and disable the OK button
in the callback and return Pt_CONTINUE. Then execute your Programming_Code()
and re-enable the OK button in the timer callback.
“Suresh Kumar” <skavula@nordson.com> wrote in message
news:ch0v3c$2kf$1@inn.qnx.com…
Hi ,
Here with i am giving my question more clearly with code for easy
understand.
Code:
int ButtonCallback (PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t
*cbinfo)
{
//Create small window from Code, Placed OK button on that window
ApCreateModule (ABM_WINDOW, NULL, cbinfo);
//Disable OK Button from user actions
PtSetResource (ABW_OKBUUTON, Pt_ARG_FLAGS, Pt_TRUE, PT_GHOST |
Pt_SELECTABLE);
//Program Code and it will take minimum one Minute
Programming_Code();
//Enable OK Button for user actions
PtSetResource (ABW_OKBUUTON, Pt_ARG_FLAGS, Pt_FALSE, PT_GHOST |
Pt_SELECTABLE);
}
My aim of above code is while programming, I want to disable OK
Button and after programming I want to make it enable. In my project this
type of situations many. How to handle this type of situations?
Looking forward with this mail,
Thanks,
With Best Regards,
Suresh.
\