You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I had a discussion about automatically reapplying the skin after changing the text of an element.
In example1 i present an example of a code where the skin are not reapply.
In example2, i present the current solution to force the reapplication of the skin.
The discution
Developper A say: when you change the text of a label or a button, the skin should automatically be reapply.
The usefull information of a ropped text is the string it contains.
Developper B say: when you change any properties of an element you do not want the skin to be reapply.
It should be the same for the RoppedText.
I think the ropped text has 2 functions:
It is the model of what you want to display and therefore should be updated by the style sheet (like adding a new element).
It is the model of how you want to display it and therefore in conflict with the style sheet (like changing a property after the installation phase of a skin).
example1
label :=ToLabelnewtext:'hello world'; addStamp:#danger; position:0@50; yourself.
button :=ToButtonnewlabelText:'Change the label'; addEventHandlerOn:BlClickEventdo: [ label text:'goodBye' ]; yourself.
space :=BlSpacenew.
space root addChild: button.
space root addChild: label.
space show.
space toTheme:ToBeeThemeGeneratednew.
When i do it the upper code in a playground i obtain the folowing picture:
If i click 2 times on the button i obtain the following picture:
We saw in this example that the skin is not reapply to the ropped text inside the label and the button.
The text should be red for the label and white for the button.
example2
labelToChange :=ToLabelnewtext:'hello world'; addStamp:#danger; position:0@50; yourself.
buttonToChange :=ToButtonnewlabelText:'hello world'; addStamp:#primary; position:100 @ 50; yourself.
button :=ToButtonnewlabelText:'Change the label';
addEventHandlerOn:BlClickEventdo: [
labelToChange text:'goodbye sky'; requestNewSkin.
buttonToChange labelText:'goodbye sky'; requestNewSkin .
];
yourself.
space :=BlSpacenew.
space root addChild: button.
space root addChild: labelToChange.
space root addChild: buttonToChange.
space show.
space toTheme:ToBeeThemeGeneratednew.
The text was updated successfully, but these errors were encountered:
Hello,
I had a discussion about automatically reapplying the skin after changing the text of an element.
In example1 i present an example of a code where the skin are not reapply.
In example2, i present the current solution to force the reapplication of the skin.
The discution
Developper A say: when you change the text of a label or a button, the skin should automatically be reapply.
The usefull information of a ropped text is the string it contains.
Developper B say: when you change any properties of an element you do not want the skin to be reapply.
It should be the same for the RoppedText.
I think the ropped text has 2 functions:
example1
When i do it the upper code in a playground i obtain the folowing picture:
If i click 2 times on the button i obtain the following picture:
We saw in this example that the skin is not reapply to the ropped text inside the label and the button.
The text should be red for the label and white for the button.
example2
The text was updated successfully, but these errors were encountered: