How to actively change the label string in visualworks smalltalk

I am trying to dynamically change a label value in ApplicationModel dynamically while my program is running. I tried:

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

But labelString did not understand to get an error. When I run:

(self builder labelAt:#Label4)

I get "UndefinedObject". Obviously, I am not returning a Label object.

+3
source share
2 answers

Try

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

or

(self widgetAt: #Label4) labelString: 'whatever'
+3
source

If you have a model for your mutable value, it is fairly easy to use only the InputField for reading that is bound to your model. I dare say that having a model for a changing value is usually a good idea.

InputField , . , .

, . Text, ComposedText Image .

0

Source: https://habr.com/ru/post/1754517/


All Articles