[Tutor] Why SelectAll() cannot work well ?

Jason Massey jason.massey at gmail.com
Thu Nov 30 17:01:41 CET 2006


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 <roka100 at gmail.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):
>         frame = wx.Frame(None, -1, "ARIA", size=(250, 100))
>         frame.Show()
>
>         self.CBox = wx.ComboBox(frame, -1, "Alicia", pos=(20, 20),
> size=(100,30), choices=ComboList)
>         self.Text = wx.StaticText(frame, -1, "ARIA", pos=(20,50))
>         # Note: EVT
>         self.CBox.Bind(wx.EVT_COMBOBOX, self.OnSelect)
>         self.CBox.Bind(wx.EVT_TEXT_ENTER, self.OnEnter)
>         #self.CBox.SetSelection(2)
>         return 1
>
>     def OnSelect(self, event):
>         Text = self.CBox.GetStringSelection()
>         self.Text.SetLabel(Text)
>
>     def OnEnter(self, event):
>         Text = self.CBox.GetValue()
>         self.Text.SetLabel(Text)
>         self.CBox.SetFocus()
>         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 '001akor at liamg.moc'.split('@')])"
> --
> \     "Unix is an operating system, OS/2 is half an operating system, |
>   `\       Windows is a shell, and DOS is a boot partition virus."  -- |
> _o__)                                                  Peter H. Coffin |
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/tutor/attachments/20061130/2ab7b27a/attachment.html 


More information about the Tutor mailing list