List Info

Thread: Why SelectAll() cannot work well ?




Why SelectAll() cannot work well ?
user name
2006-11-30 16:01:41
I'm running WinXP and the entire text is selected when you enter a new choice.  In fact, on XP at least, you don't have to use SelectAll, SetFocus selected the entire text.



On 11/30/06, Jia Lu < roka100gmail.com">roka100gmail.com> wrote:
Hi all

I am using wx Py with FC6. I ran the program below but I found the method SelectAll() cannot work well.(The last letter didnot be selected.!!)
------------------
import wx

ComboList = ['Akari', 'Aika', 'Alice']

class MyApp(wx.App):
   ; def OnInit(self):
 &nbsp;   ; &nbsp; frame = wx.Frame(None, -1, "ARIA", size=(250, 100))
&nbsp; &nbsp; &nbsp; &nbsp; frame.Show()
 &nbsp; &nbsp; &nbsp;  
&nbsp; &nbsp; &nbsp; &nbsp; self.CBox = wx.ComboBox(frame, -1, "Alicia", pos=(20, 20), size=(100,30), choices=ComboList)
&nbsp;   ; &nbsp; &nbsp;self.Text = wx.StaticText(frame, -1, "ARIA", pos=(20,50))
 &nbsp; &nbsp;   ; # Note: EVT
   ; &nbsp; &nbsp; self.CBox.Bind(wx.EVT_COMBOBOX, self.OnSelect)
   ; &nbsp; &nbsp; self.CBox.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
 ; &nbsp; &nbsp; &nbsp; #self.CBox.SetSelection(2)
 &nbsp;   ; &nbsp; return 1
 &nbsp; &nbsp;   
&nbsp; &nbsp; def OnSelect(self, event):
&nbsp; &nbsp;   ; &nbsp;Text = self.CBox.GetStringSelection()
&nbsp;   ; &nbsp; &nbsp;self.Text.SetLabel(Text)

&nbsp; &nbsp; def OnEnter(self, event):
&nbsp;   ; &nbsp; &nbsp;Text = self.CBox.GetValue()
  ; &nbsp; &nbsp; &nbsp;self.Text.SetLabel(Text)
&nbsp; &nbsp; &nbsp; &nbsp; self.CBox.SetFocus()
&nbsp;   ; &nbsp; &nbsp;self.CBox.SelectAll()

app = MyApp()
app.MainLoop()



--
-- Jia LU
< http://www.lujia.us>
Registered Linux user #434792
python -c "print ''.join(['.'.join([w[::-1] for w in p.split('.')]) for p in ' 001akorliamg.moc" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)"> 001akorliamg.moc'.split('')])"
--
 &nbsp; &nbsp; "Unix is an operating system, OS/2 is half an operating system, |
 &nbsp;` &nbsp;   ;  Windows is a shell, and DOS is a boot partition virus.&quot; &nbsp;-- |
_o__)&nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; &nbsp;   ; &nbsp; &nbsp; &nbsp; Peter H. Coffin |

_______________________________________________
Tutor maillist  -  python.org">Tutorpython.org
http://mail.python.org/mailman/listinfo/tutor



[1]

about | contact  Other archives ( Real Estate discussion Medical topics )