Извиняюсь ошибся, предыдущий пример работает в windows 7, а в Linux нет.
Ещё возникла другая проблема, если заменить один TextCtrl на masked.TextCtrl, то и в винде курсор начинает останавливаться на edtBirthDay
# -*- coding: utf-8 -*-
import wx
import wx.lib.masked.textctrl as masked
class newPeopleFrame(wx.Frame):
def __init__(self, *args, **kwds):
kwds["style"] = wx.DEFAULT_FRAME_STYLE
wx.Frame.__init__(self, *args, **kwds)
self.lblSurName = wx.StaticText(self, -1, u"Фамилия")
self.lblFirstName = wx.StaticText(self, -1, u"Имя")
self.lblPatName = wx.StaticText(self, -1, u"Отчество")
self.lblBirthDay = wx.StaticText(self, -1, u"Дата рождения")
self.lblAddress = wx.StaticText(self, -1, u"Адрес")
self.lblTel = wx.StaticText(self, -1, u"Тел.")
self.lblFioMather = wx.StaticText(self, -1, u"Ф.И.О матери")
self.lblPlaceWork = wx.StaticText(self, -1, u"Место работы")
self.edtSurName = wx.TextCtrl(self, -1, "")
self.edtFirstName = wx.TextCtrl(self, -1, "")
self.edtPatName = wx.TextCtrl(self, -1, "")
self.edtBirthDay = masked.TextCtrl(self, -1, " . . ",
(-1, -1), (100, 24))
self.edtAddress = wx.TextCtrl(self, -1, "")
self.edtTel = wx.TextCtrl(self, -1, "")
self.edtFioMather = wx.TextCtrl(self, -1, "")
self.edtPlaceWork = wx.TextCtrl(self, -1, "")
self.__set_properties()
self.__do_layout()
def __set_properties(self):
self.SetTitle(u"Новый")
self.SetSize((500, 400))
self.edtBirthDay.SetMask("##.##.####")
self.edtBirthDay.SetDatestyle("DMY")
def __do_layout(self):
grid_sizer = wx.FlexGridSizer(8, 2, 5, 0)
grid_sizer.Add(self.lblSurName, 0, wx.EXPAND)
grid_sizer.Add(self.edtSurName, 0, wx.EXPAND)
grid_sizer.Add(self.lblFirstName, 0, wx.EXPAND)
grid_sizer.Add(self.edtFirstName, 0, wx.EXPAND)
grid_sizer.Add(self.lblPatName, 0, wx.EXPAND)
grid_sizer.Add(self.edtPatName, 0, wx.EXPAND)
grid_sizer.Add(self.lblBirthDay, 0, wx.EXPAND)
grid_sizer.Add(self.edtBirthDay, 0)
grid_sizer.Add(self.lblAddress, 0, wx.EXPAND)
grid_sizer.Add(self.edtAddress, 0, wx.EXPAND)
grid_sizer.Add(self.lblTel, 0, wx.EXPAND)
grid_sizer.Add(self.edtTel, 0, wx.EXPAND)
grid_sizer.Add(self.lblFioMather, 0, wx.EXPAND)
grid_sizer.Add(self.edtFioMather, 0, wx.EXPAND)
grid_sizer.Add(self.lblPlaceWork, 0, wx.EXPAND)
grid_sizer.Add(self.edtPlaceWork, 0, wx.EXPAND)
grid_sizer.AddGrowableCol(1)
self.SetSizer(grid_sizer)
self.Layout()
if __name__ == "__main__":
app = wx.PySimpleApp(0)
wx.InitAllImageHandlers()
frame_2 = newPeopleFrame(None, -1, "")
app.SetTopWindow(frame_2)
frame_2.Show()
app.MainLoop()