Aha! Thank you.
But how does that help to resolve my variant timer skin?
I'll take a look see if I can figure out how escaping a variable might be the answer
It is currently May 6th, 2024, 1:26 am
String meter won't update
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: String meter won't update
The important point to take out of this is that all #Variables# are "resolved" where they are used.
In this case, it matters whether the variable is resolved in the bang, before it is set as the value of the Text option on the meter, or whether the variable is resolved in the meter itself. If you don't escape the variable in the bang, it will be resolved there, and in my example the value of the Text option will be set to Text=Red. It will STAY Text=Red, forever... If you do escape the variable in the bang, then the literal #SomeVariable# will be set on the Text option, the Text option will then be Text=#SomeVariable#, and the variable will be resolved in the meter, changing when the value of the variable changes.
The point of the * (escape) is to say "Don't resolve this variable! Treat it as a literal string!".
In this case, it matters whether the variable is resolved in the bang, before it is set as the value of the Text option on the meter, or whether the variable is resolved in the meter itself. If you don't escape the variable in the bang, it will be resolved there, and in my example the value of the Text option will be set to Text=Red. It will STAY Text=Red, forever... If you do escape the variable in the bang, then the literal #SomeVariable# will be set on the Text option, the Text option will then be Text=#SomeVariable#, and the variable will be resolved in the meter, changing when the value of the variable changes.
The point of the * (escape) is to say "Don't resolve this variable! Treat it as a literal string!".
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
Re: String meter won't update
Code: Select all
LeftMouseUpAction=
[!SetOptionGroup Button FillAlpha "Fill Color #Color5#"]
[!SetOption #CURRENTSECTION# FillAlpha "Fill Color #Color2#"]
[!WriteKeyValue Variables Act "[#[#CURRENTSECTION]]"]
[!WriteKeyValue Variables ActionText [#CURRENTSECTION]]
[!SetVariable Act "[#[#CURRENTSECTION]]"]
[!SetVariable ActionText [#CURRENTSECTION]]
[!UpdateMeter *][!Redraw]
[#[#CURRENTSECTION#]]eclectic-tech wrote: ↑October 19th, 2021, 2:37 pm
LeftMouseUpAction=[!SetOptionGroup Button FillAlpha "Fill Color #Color5#"][!SetOption #CURRENTSECTION# FillAlpha "Fill Color #Color2#"][!WriteKeyValue Variables Act "[#[#CURRENTSECTION#]]"] [!WriteKeyValue Variables ActionText [#CURRENTSECTION]] [!SetVariable Act "[#[#CURRENTSECTION#]]"] [!SetVariable ActionText [#CURRENTSECTION]][!UpdateMeter *][!Redraw]
[#[#CURRENTSECTION]]
Probably a typo
from the Realm of Death
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
Re: String meter won't update
I don't think he wants to escape that variable. From his previous replies I think his variable isn't getting resolved due to some reason, or resolved to something else.jsmorley wrote: ↑October 19th, 2021, 4:37 pm The important point to take out of this is that all #Variables# are "resolved" where they are used.
In this case, it matters whether the variable is resolved in the bang, before it is set as the value of the Text option on the meter, or whether the variable is resolved in the meter itself. If you don't escape the variable in the bang, it will be resolved there, and in my example the value of the Text option will be set to Text=Red. It will STAY Text=Red, forever... If you do escape the variable in the bang, then the literal #SomeVariable# will be set on the Text option, the Text option will then be Text=#SomeVariable#, and the variable will be resolved in the meter, changing when the value of the variable changes.
The point of the * (escape) is to say "Don't resolve this variable! Treat it as a literal string!".
from the Realm of Death
-
- Developer
- Posts: 22631
- Joined: April 19th, 2009, 11:02 pm
- Location: Fort Hunt, Virginia, USA
Re: String meter won't update
That's as may be. I have not followed this thread really. I was just reacting to what I perceived to be some confusion about what "escaping" variables and section variables is used for.death.crafter wrote: ↑October 19th, 2021, 4:42 pm I don't think he wants to escape that variable. From his previous replies I think his variable isn't getting resolved due to some reason, or resolved to something else.
-
- Rainmeter Sage
- Posts: 1399
- Joined: April 24th, 2021, 8:13 pm
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: String meter won't update
@jsmorley: I see, thanks, I'll have to reread this probably so I'll bookmark it
@death.crafter: Well, that's the weird thing. It works in one skin, so I copied and pasted the LeftMouseUpAction into the second skin, but it doesn't work there. I did have to change the colour variable names, but that was all.
Works, but now the Actions have stopped working:
Doesn't work:
Basically, there's a set of buttons that select a function or action to be taken upon timer reaching zero. There is another meter that tells which button is selected so you know which action is to be taken when the settings, buttons, are closed. This text meter is NOT updated unless the skin is refreshed, which I don't want. The !WriteKey is used to permanently set this, but I am trying to use the !SetVariables to change the meter without a skin refresh. Hopefully that explains my intention?
Does the order of these bangs make a difference?
@death.crafter: Well, that's the weird thing. It works in one skin, so I copied and pasted the LeftMouseUpAction into the second skin, but it doesn't work there. I did have to change the colour variable names, but that was all.
Works, but now the Actions have stopped working:
Does the order of these bangs make a difference?
Last edited by sl23 on October 19th, 2021, 5:01 pm, edited 1 time in total.
- MuLab -
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away
Re: String meter won't update
No you're not butting in, you have been a great help now and in the past, I thank you for any input.
The thing about using correct syntax for Nesting variables was useful, I just found it broke things when I tried to change skins to that way, I was being lazy so I left it!
- MuLab -
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: String meter won't update
@ death.crafter Yeah, that was a typo, but it works either using standard variable or nested in that portion of the bang
The alternate skin sl23 posted earlier also has a typo in [sButton]; you wrote different values for the #Act# variable in the !WriteKeyValue bang and the !SetVariable bang.
The reason the text doesn't update in that skin is due to not having DynamicVariables=1 in the [Action] section message.
Make changes to these 2 sections and it should update the action message.
The alternate skin sl23 posted earlier also has a typo in [sButton]; you wrote different values for the #Act# variable in the !WriteKeyValue bang and the !SetVariable bang.
The reason the text doesn't update in that skin is due to not having DynamicVariables=1 in the [Action] section message.
Make changes to these 2 sections and it should update the action message.
Code: Select all
;========================================
; Message
;========================================
[Action]
Meter=String
MeterStyle=sAllText
FontSize=9
FontColor=#ActionFont#
Text=#ActionText#
X=30
Y=66
DynamicVariables=1
; {trimmed code}
[sButton]
Shape=Rectangle 0,0,8,8,5 | Extend FillAlpha | StrokeWidth 2 | Extend StrokeAlpha
FillAlpha=Fill Color #White60#
StrokeAlpha=Stroke Color #Trans#
LeftMouseUpAction=[!SetOptionGroup Button FillAlpha "Fill Color #White60#"][!SetOption #CURRENTSECTION# FillAlpha "Fill Color #Red#"][!WriteKeyValue Variables Act "[#[#CURRENTSECTION]]"] [!WriteKeyValue Variables ActionText [#CURRENTSECTION]] [!SetVariable Act "[#[#CURRENTSECTION]]"][!SetVariable ActionText "[#CURRENTSECTION]"][!UpdateMeter *][!Redraw]
MouseOverAction=[!SetOption #CURRENTSECTION# StrokeAlpha "StrokeColor #White#"] [!UpdateMeter *][!Redraw]
MouseLeaveAction=[!SetOption #CURRENTSECTION# StrokeAlpha ""] [!UpdateMeter *] [!Redraw]
ToolTipText=[#CURRENTSECTION]
DynamicVariables=1
Group=Button
Hidden=1
UpdateDivider=-1
X=3R
Y=r
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Posts: 1140
- Joined: February 17th, 2011, 7:45 pm
- Location: a Galaxy S7 far far away