Skip to content Skip to sidebar Skip to footer

String Or Unicode Type Required, Wxpython Statictext

I'm trying to make a wxPython static text widget. For some reason I keep getting the error below. Snippet: self.Label = wx.StaticText(self, pos=(sw/2.0 - w/2.0, sh/2.0 - h/2.0), l

Solution 1:

Label is a property of wx.Frame, and trying to assign anything other than a String to it is not allowed. For reference: http://www.wxpython.org/docs/api/wx.Window-class.html#SetLabel (wx.Frame is a subclass of wx.Window)

Solution 2:

You need to specify all the argument names , self is being taken as datatype of some sort not as an argument, So in your code your have to replace self with parent = self

Post a Comment for "String Or Unicode Type Required, Wxpython Statictext"