<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Hi </span></font><font size=2 face=Tahoma><span
style='font-size:10.0pt;font-family:Tahoma'>Jared,<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'> Thanks so much for your advice, it solved the problem of loading
file all into 1 line, so loading is so much faster now!<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'> I am still trying to figure out the cursor movement issues.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma'> All the best.</span></font><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'> <a
name="OLE_LINK8"></a><a name="OLE_LINK7">Jared </a>Forsyth
[mailto:jabapyth@gmail.com] <br>
<b><span style='font-weight:bold'>Sent:</span></b> Thursday, August 14, 2008
7:41 AM<br>
<b><span style='font-weight:bold'>To:</span></b> Igor Kaplan<br>
<b><span style='font-weight:bold'>Cc:</span></b> pythonce@python.org<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [PythonCE]
Programaticly moving cursor in multi-line edit control</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>The way to preserve
linebreaks is tp replace "\n" with "\r\n"<br>
so: self.text_entry.text = fl.read().replace("\n","\r\n")<o:p></o:p></span></font></p>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>On Wed, Aug 13, 2008 at 8:05 PM, Igor Kaplan <<a
href="mailto:igor_kaplan@hotmail.com">igor_kaplan@hotmail.com</a>> wrote:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hello,<br>
<br>
I would like to ask a little advice. Already several days I am trying to<br>
figure out the following problem using ppygui: How to move the cursor in the<br>
edit field to the top of that field.<br>
In my code I create the frame and then Edit control:<br>
Self.text_entry = gui.Edit(multiline=True)<br>
sizer = gui.VBox(border=(2,2,2,2), spacing=2)<br>
sizer.add(self.text_entry)<br>
.<br>
<br>
Later I open the text file and copy it's context into that edit control:<br>
fl = open(self.filename, 'r')<br>
l = fl.readlines()<br>
self.text_entry.text = ""<br>
for i in l:<br>
self.text_entry.append(i)<br>
<br>
Only reason why I add the text such long way because if I just do:<br>
Self.text_entry.text = fl.read()<br>
I looze all line breaks and all text goes into 1 line.<br>
<br>
After opening that file I do:<br>
Self.text_entry.selection = 0, 0<br>
<br>
And that line does nothing. For some reasons the cursor always positions<br>
at the same spot in the Edit box after opening the file, somewhere in the<br>
middle and does not want to go to the beginning.<br>
<br>
I also have another event:<br>
Def OnBegin(self, event):<br>
Self.text_entry.selection = 0, 0<br>
<br>
That event executes on menu item. And something interesting is going on.<br>
Sometimes cursor goes to the beginning of the edit control as it should do,<br>
sometimes moves to some line of the edit box, again, somewhere at the<br>
middle, sometimes just stays where it was.<br>
<br>
I am not sure, if I am doing something incorrectly or positioning of the<br>
cursor does not work in ppygui?<br>
Would greatly appreciate any advice!<br>
<br>
Many thanks.<br>
<br>
Igor.<br>
<br>
<br>
_______________________________________________<br>
PythonCE mailing list<br>
<a href="mailto:PythonCE@python.org">PythonCE@python.org</a><br>
<a href="http://mail.python.org/mailman/listinfo/pythonce" target="_blank">http://mail.python.org/mailman/listinfo/pythonce</a><o:p></o:p></span></font></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</div>
</body>
</html>