Add text control to frame : Text : WxPython PYTHON TUTORIALS


PYTHON TUTORIALS » WxPython » Text »

 

Add text control to frame


Add text control to frame
import wx

class MyFrame(wx.Frame):

    def __init__(self):
        wx.Frame.__init__(self, None, -1"My Frame", size=(300300))
        panel = wx.Panel(self, -1)
        panel.Bind(wx.EVT_MOTION,  self.OnMove)
        wx.StaticText(panel, -1"Pos:", pos=(1012))
        self.posCtrl = wx.TextCtrl(panel, -1"", pos=(4010))

    def OnMove(self, event):
        pos = event.GetPosition()
        self.posCtrl.SetValue("%s, %s" (pos.x, pos.y))

app = wx.PySimpleApp()
frame = MyFrame()
frame.Show(True)
app.MainLoop()



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


PYTHON TUTORIALS

 Navioo WxPython
» Text