How to hold back cursor movement in PtText Widget?

Hi, all

I got in trouble when using PtText widget. I wrote an program under Photon.
My purpose is like this:
Use a pattern for the text entered into the text field of PtText. If the
input character is not the rightcharacter, prevent it and make the cursor
position unchanged.

It’s easy to prevent the character from entering the text field by using
Pt_CB_MOTIFY_VERIFY.But after the callback the cursor still move to the next
position( new_insert position ). I try using Pt_CB_MOTION_VERIFY, but it
seems that It never been invoked.

How to solve this problem?

Thanks.

Lp

Hello Lp,

Take a look at the docs for the PtText widget found at
http://qdn.qnx.com/support/docs/photon_2.0_en/widget_ref/pttext.html
There is some code that deals with passwords in there that you can
modify for your purpose.

I hope this helps.

Regards,
Dave B.





lp wrote:

Hi, all

I got in trouble when using PtText widget. I wrote an program under Photon.
My purpose is like this:
Use a pattern for the text entered into the text field of PtText. If the
input character is not the rightcharacter, prevent it and make the cursor
position unchanged.

It’s easy to prevent the character from entering the text field by using
Pt_CB_MOTIFY_VERIFY.But after the callback the cursor still move to the next
position( new_insert position ). I try using Pt_CB_MOTION_VERIFY, but it
seems that It never been invoked.

How to solve this problem?

Thanks.

Lp


\