Note: This was a question on chat
How do I change the style of the button on press?
l: layout [
style bteal button teal
style bred button red
b1: bteal "Ok" [b1/style: 'bred]
]
view l
Want to change like this on button
click:
The answer has probably something to do with vid being a dialect.
Also, how the style
word evaluates it's content
Addendum
Probably not.
Before:
>> ? b1/style
B1/STYLE is a word of value: bteal
After:
>> ? b1/style
B1/STYLE is a word of value: bred
So, what is being set is correct. Perhaps an event needs to be triggered?
style
has a meaning inlayout
function only,layout
function uses it as a shortcut to generate new faces with predefined facets (color, size etc.)So, changing a face's style doesn't change anything. You need to change the facets (properties of the face) directly.
But if you do the same on a
button
you may confused because its color wouldn't be changed:It is because buttons have some effects in
effects
facet and the color is defined there during the generation of face inside layout function.if you
clear
that block then you can see the change or you should change that block accordingly.Edit:
Here is a working version of your example: