Search code examples
smalltalkvisualworks

How to actively change a label's string in visualworks smalltalk


I am trying to dynamically change the value of a label in an ApplicationModel dynamically during the running of my program. I have tried:

(self builder labelAt: #Label4) labelString: 'Dynamic text here'.

But get a labelString not understood error. When I run:

(self builder labelAt:#Label4)

I get "UndefinedObject". Which obviously suggests that I am not returning my Label object.


Solution

  • Try

    (self builder componentAt: #Label4) widget labelString: 'whatever'
    

    or

    (self widgetAt: #Label4) labelString: 'whatever'