Problem with DirectLabel

Hello!

I’m having this problem to use the setText of the DirectLabel, I hope someone can help!

I have this class (it´s just the piece that matters):

class Interface:
    def __init__(self, ObjMgr):

   self.frame_main = DirectFrame(scale = 0.1,
                            relief = GROOVE, 
                            frameSize = (-14, 14, -2.5, 2.5),
                            pos = (0, 0, -0.75),
                            frameColor = (200, 200, 200, 0.5)) 

   self.main_label = DirectLabel(self.frame_main, text="Default            Text",scale=0.5, pos =(-9,0,0),frameSize = (-8, 8, -4, 4), frameColor = (0, 0, 0, 0.1), text_pos=(-1,2.3), text_fg=(1,1,1,1))
      

And when I try to do this:


self.main_label.setText("New Text")

I alway get this error :

TypeError: setText() takes exactly 1 argument (2 given)

That’s because of the hidden passing of ‘self’ , but how can I avoid it?
Anyone can help me? :confused:

Thanks !

Don’t call label.setText(). That’s an internal method that’s not intended to be called by the user. To change the text of a label, use label[‘text’] = “New Text”.

David