Re: Programaticly moving cursor in multi-line edit

View: New views
1 Messages — Rating Filter:   Alert me  

Parent Message unknown Re: Programaticly moving cursor in multi-line edit

by Igor Kaplan :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Alexandre,

  Thanks a lot for your suggestion, it worked, so now moving to the
beginning and to the end of the edit control works perfectly fine.
  Ppygui is being such a wonderful library, just love it!

  Many thanks and all the best.

  Igor.

From: Alexandre Delattre <alexandre.delattre@...>
Subject: Re: [PythonCE] Programaticly moving cursor in multi-line edit
        control
To: pythonce@...
Message-ID: <48A47BBC.6060009@...>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Igor,

I've tested your app, and what happens really is that the cursor itself is
moved at the beginning but the edit isn't scrolled to make it visible (if
you press an hardware key or try to insert a few characters, you'll be then
scrolled at the beginning). This seems to be the normal behaviour of windows
ce.

There is at least 2 way to solve that:

1) Use the line proposed by Jared to make the conversion between unix and
windows line endings, so the problem isn't even ask. I recommand you to use
this in your case.

2) Make some "invisible" changes at the beginning of the Edit, so that the
view is scrolled to show the change, you can use this snippet:

self.text_entry.selection = 0, 1
self.text_entry.selected_text = self.text_entry.selected_text
self.text_entry.selection = 0, 0

I think that, later, I'll surely implement scrolling methods so that kind of
stuff could be done much more cleanly.

Hope it helps,
Alexandre



_______________________________________________
PythonCE mailing list
PythonCE@...
http://mail.python.org/mailman/listinfo/pythonce