How can one move the blinking cursor in the wx.TextCtrl to another position (say, to the position zero) by using a method?
Hi
···
On Mon, Oct 25, 2010 at 4:33 PM, Boštjan Mejak <bostjan.mejak@gmail.com> wrote:
How can one move the blinking cursor in the wx.TextCtrl to another position
(say, to the position zero) by using a method?--
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
See wx.TextCtrl.SetInsertionPoint()
Cody
I have used this same method (SetInsertionPoint) in my app and it does not work. I am using the NumCtrl (a derivative of wx.TextCtrl) found in wx.lib.masked. Please tell me why is it not working at all.
···
On Mon, Oct 25, 2010 at 11:47 PM, Cody Precord codyprecord@gmail.com wrote:
Hi
On Mon, Oct 25, 2010 at 4:33 PM, Boštjan Mejak bostjan.mejak@gmail.com wrote:
How can one move the blinking cursor in the wx.TextCtrl to another position
(say, to the position zero) by using a method?
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
See wx.TextCtrl.SetInsertionPoint()
Cody
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
…why is SetInsertionPoint not working if used on the NumCtrl object.
···
On Tue, Oct 26, 2010 at 11:19 AM, Boštjan Mejak bostjan.mejak@gmail.com wrote:
I have used this same method (SetInsertionPoint) in my app and it does not work. I am using the NumCtrl (a derivative of wx.TextCtrl) found in wx.lib.masked. Please tell me why is it not working at all.
On Mon, Oct 25, 2010 at 11:47 PM, Cody Precord codyprecord@gmail.com wrote:
Hi
On Mon, Oct 25, 2010 at 4:33 PM, Boštjan Mejak bostjan.mejak@gmail.com wrote:
How can one move the blinking cursor in the wx.TextCtrl to another position
(say, to the position zero) by using a method?
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
See wx.TextCtrl.SetInsertionPoint()
Cody
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
And let me mention that I am using wxPython 2.9.1.1 for Python 2.7.
···
On Tue, Oct 26, 2010 at 11:20 AM, Boštjan Mejak bostjan.mejak@gmail.com wrote:
…why is SetInsertionPoint not working if used on the NumCtrl object.
On Tue, Oct 26, 2010 at 11:19 AM, Boštjan Mejak bostjan.mejak@gmail.com wrote:
I have used this same method (SetInsertionPoint) in my app and it does not work. I am using the NumCtrl (a derivative of wx.TextCtrl) found in wx.lib.masked. Please tell me why is it not working at all.
On Mon, Oct 25, 2010 at 11:47 PM, Cody Precord codyprecord@gmail.com wrote:
Hi
On Mon, Oct 25, 2010 at 4:33 PM, Boštjan Mejak bostjan.mejak@gmail.com wrote:
How can one move the blinking cursor in the wx.TextCtrl to another position
(say, to the position zero) by using a method?
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
See wx.TextCtrl.SetInsertionPoint()
Cody
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
Because the wx.lib.masked code is also using SetInsertionPoint to set the insertion point to where it wants the caret to be positioned, and it is probably being done with wx.CallAfter so it is happening after your own call to SetInsertionPoint. If you want different behavior then you'll probably need to just use a wx.TextCtrl and do your own validation for ensuring that only numbers are entered.
···
On 10/26/10 2:19 AM, Boštjan Mejak wrote:
I have used this same method (SetInsertionPoint) in my app and it does
not work. I am using the NumCtrl (a derivative of wx.TextCtrl) found in
wx.lib.masked. Please tell me why is it not working at all.
--
Robin Dunn
Software Craftsman
How can you make the wx.TextCtrl widget to only accept numbers?
···
On Tue, Oct 26, 2010 at 9:28 PM, Robin Dunn robin@alldunn.com wrote:
On 10/26/10 2:19 AM, Boštjan Mejak wrote:
I have used this same method (SetInsertionPoint) in my app and it does
not work. I am using the NumCtrl (a derivative of wx.TextCtrl) found in
wx.lib.masked. Please tell me why is it not working at all.
Because the wx.lib.masked code is also using SetInsertionPoint to set the insertion point to where it wants the caret to be positioned, and it is probably being done with wx.CallAfter so it is happening after your own call to SetInsertionPoint. If you want different behavior then you’ll probably need to just use a wx.TextCtrl and do your own validation for ensuring that only numbers are entered.
–
Robin Dunn
Software Craftsman
–
To unsubscribe, send email to wxPython-users+unsubscribe@googlegroups.com
or visit http://groups.google.com/group/wxPython-users?hl=en
Hi,
···
On Tue, Oct 26, 2010 at 3:37 PM, Boštjan Mejak <bostjan.mejak@gmail.com> wrote:
How can you make the wx.TextCtrl widget to only accept numbers?
See the Validators example in the wxpython demo app.
Cody