Problem with auto-selection in wx masked control

  • Thread starter jean-michel bain-cornu
  • Start date
J

jean-michel bain-cornu

Hi all,

I'm trying to get the whole field selected when the caret arrives into a
wx masked control.
This is perfectly done with the program below.
But if I comment out the line "r= dlg.ShowModal()", I get something
different : the data within the field is no more correctly selected.
Why ? And is there any solution ?
If somebody have got an idea, I'd be delighted.

Cheers,
jm

#------------------------------------------------------------------------
import wx
from wx.lib import masked
#--
class TestPanel( wx.Panel ):
def __init__( self, parent):
wx.Panel.__init__( self, parent, -1 )
self.mask1 = masked.NumCtrl( self, -1, name="target control",
pos=(20,50))
self.mask1.SetSelectOnEntry(True)
self.mask1.SetValue(123.45678)
self.Show()
#--
class MainWindow(wx.Frame):
def __init__(self,parent,id, title):
wx.Frame.__init__(self,parent,wx.ID_ANY,title,size=(200 ,200))
win = TestPanel(self)
dlg = wx.MessageDialog(self, 'Confirm')
r= dlg.ShowModal()
dlg.Destroy()
self.Show()
#--
app = wx.PySimpleApp()
frame=MainWindow(None,-1,'')
app.MainLoop()
#------------------------------------------------------------------------
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top