From: Vihang Patil on 21 Jun 2010 04:40 Hello, Is there any way that the edit box's contents be updated on the handles structure only once on keypress? ex: I have a GUI with one edit box and one text box, I have writted a code in the edit box's callback function such that whenever there is a keypress then the count in the text box increments. But I need to increment the count on the text box only once when I have depressed the Enter Key. But what I have observed is that as long as the ENTER key is pressed the counter keeps on incrementing in the text box. How do I avoid this ? Thanks Vihang
From: Walter Roberson on 21 Jun 2010 10:10 Vihang Patil wrote: > Is there any way that the edit box's contents be updated on the handles > structure only once on keypress? > ex: I have a GUI with one edit box and one text box, I have writted a > code in the edit box's callback function such that whenever there is a > keypress then the count in the text box increments. But I need to > increment the count on the text box only once when I have depressed the > Enter Key. But what I have observed is that as long as the ENTER key is > pressed the counter keeps on incrementing in the text box. How do I > avoid this ? Record the last key in the Userdata field of the edit box, and when you get a new key if it is enter and the previous one was enter too then ignore the new one.
From: Vihang Patil on 6 Jul 2010 05:39 Walter Roberson <roberson(a)hushmail.com> wrote in message <spKTn.64524$h57.55704(a)newsfe22.iad>... > > Record the last key in the Userdata field of the edit box, and when you > get a new key if it is enter and the previous one was enter too then > ignore the new one. Thanks Walter That was an easy solution Regards Vihang
|
Pages: 1 Prev: Change subject of an expression Next: Initializing IMPLAY from Matlab Code |