I have a made a small application please find the code below..
···
#############################################
import wx
[wxID_FRAME1, wxID_FRAME1PANEL1, wxID_FRAME1TEXTCTRL1,
] = [wx.NewId() for _init_ctrls in range(3)]
class Frame1(wx.Frame):
def _init_sizers(self):
# generated method, don't edit
self.boxSizer1 = wx.BoxSizer(orient=wx.VERTICAL)
self._init_coll_boxSizer1_Items(self.boxSizer1)
self.SetSizer(self.boxSizer1)
def _init_coll_boxSizer1_Items(self, parent):
# generated method, don't edit
parent.AddWindow(self.panel1, 1, border=0, flag=wx.EXPAND)
def _init_ctrls(self, prnt):
# generated method, don't edit
wx.Frame.__init__(self, id=wxID_FRAME1, name='', parent=prnt,
pos=wx.Point(365, 321), size=wx.Size(322, 167),
style=wx.DEFAULT_FRAME_STYLE, title='Frame1')
self.SetClientSize(wx.Size(314, 133))
self.panel1 = wx.Panel(id=wxID_FRAME1PANEL1, name='panel1',
parent=self,
pos=wx.Point(0, 0), size=wx.Size(314, 133),
style=wx.TAB_TRAVERSAL)
self.textCtrl1 = wx.TextCtrl(id=wxID_FRAME1TEXTCTRL1,
name='textCtrl1',
parent=self.panel1, pos=wx.Point(64, 56), size=wx.Size
(100, 21),
style=0, value=u'')
self._init_sizers()
def __init__(self, parent):
self._init_ctrls(parent)
self.textCtrl1.SetFocus()
def OnTaskBarRight(event):
app.ExitMainLoop()
def OnTaskBarLeft(event):
main=Frame1(None)
app.SetTopWindow(main)
main.Show();
#setup app
app= wx.PySimpleApp()
#setup icon object
icon = wx.Icon("favicon.ico", wx.BITMAP_TYPE_ICO)
#setup taskbar icon
tbicon = wx.TaskBarIcon()
tbicon.SetIcon(icon, "I am an Icon")
#add taskbar icon event
wx.EVT_TASKBAR_RIGHT_UP(tbicon, OnTaskBarRight)
tbicon.Bind(wx.EVT_TASKBAR_LEFT_DOWN, OnTaskBarLeft)
app.MainLoop()
Thanks
Thomas
On Jul 18, 1:20 am, Mike Driscoll <kyoso...@gmail.com> wrote:
Thomas,
On Jul 16, 11:46 pm, thomas <tctho...@gmail.com> wrote:
> > >I also noticed first time even after having the focus (I see the
> > >cursor in the textctrl)frame not accepting key board press on the
> > >textctrl . This is not happening the next time I left click to open
> >> it.
> >For this, you may need to call SetFocus on the TextCtrl.
> This is still no accepting key press. If i close and open the frame
> again it works fine.
> It's only happening the very first time.
Can you produce a small runnable sample for us to play with?
Mike