hi i trying to use statusbar in my app with ok here es the code
def OnSize....
def CreateStBar(self):
self.stbar = wx.StatusBar(self, -1)
self.stbar.SetFieldsCount(8)
self.stbar.SetStatusText("Ready", 0)
self.stbar.SetStatusWidths([-2, -1, -1, -1, -1, -1, -1, -2])
self.SetStatusBar(self.stbar)
self.col = wx.StaticText(self.stbar, -1, "Col",
wx.DefaultPosition, wx.DefaultSize)
self.line = wx.StaticText(self.stbar, -1, "Line",
wx.DefaultPosition, wx.DefaultSize)
self.stxt = wx.StaticText(self.stbar, -1,
"file"+self.filename, wx.DefaultPosition, wx.DefaultSize)
self.grun = wx.Gauge(self.stbar, -1)
self.Reposition()
def Reposition(self):
crect = self.stbar.GetFieldRect(1)
self.col.SetPosition((crect.x+2, crect.y+2))
self.col.SetSize((crect.width-4, crect.height-4))
lrect = self.stbar.GetFieldRect(2)
self.line.SetPosition((lrect.x+15, lrect.y+2))
self.line.SetSize((lrect.width-15, lrect.height-4))
srect = self.stbar.GetFieldRect(3)
self.stxt.SetPosition((srect.x+15, srect.y+2))
self.stxt.SetSize((srect.width-15, srect.height-4))
grect = self.stbar.GetFieldRect(7)
self.grun.SetPosition((grect.x+2, grect.y+2))
self.grun.SetSize((grect.width-4, grect.height-4))
self.sizechanged = False
and here is the error
Traceback (most recent call last):
File "C:\Users\ozkar\Dropbox\script\main.py", line 77, in OnSize
self.Reposition()
File "C:\Users\ozkar\Dropbox\script\main.py", line 97, in Reposition
crect = self.stbar.GetFieldRect(1)
AttributeError: 'Frame' object has no attribute 'stbar'
I Don't know whats wronw here
i have other application with the same code and it runs perfect