It is currently April 27th, 2024, 1:44 pm

!Update not updating all measures

Report bugs with the Rainmeter application and suggest features.
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

!Update not updating all measures

Post by balala »

Hello everyone.
I just figured out something and have to ask if someone else has figured out the same issue before, as well.
If applying the !Update bang, all measures and meters of the skin are updated, excepting the measures which have set an UpdateDivider=-1 option. Obviously, if I add a !UpdateMeasure bang, the measure(s) in cause is/are updated, but are not by the !Update bang.
Example code:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
Num=0

[MeasureCalc]
Measure=Calc
Formula=#Num#
DynamicVariables=1
UpdateDivider=-1

[MeterCalc]
Meter=STRING
MeasureName=MeasureCalc
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Variable: #Num##CRLF#Measure: %1
LeftMouseUpAction=[!SetVariable Num "(1-#Num#)"][!Update]
DynamicVariables=1
UpateDivider=-1
As you can see, both, the [MeasureCalc] and the [MeterCalc] sections have an UpdateDivider=-1 option. When clicking the [MeterCalc] meter, the value of the Num variable is altered between 0 and 1. The [MeasureCalc] measure should follow this value. But although when you click, the Num variable is changing its value (this can be seen in the first line of the string), the measure doesn't follow this (as seen in the second line). If I remove the UpdateDivider=-1 option from the [MeasureCalc] measure, the measure is obviously updated properly. Even if the [MeterCalc] meter has the same UpdateDivider=-1 option, it doesn't seem to be affected by this problem: it is updated properly.
If I replace the [!Update] bang of the LeftMouseUpAction option of the [MeterCalc] meter by a [!UpdateMeasure "MeasureCalc"] (or even an [!UpdateMeasure *]), I get the measure updated correctly.
Is this something known?
Thank you in advance.
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: !Update not updating all measures

Post by Yincognito »

balala wrote: September 28th, 2023, 7:21 pm Hello everyone.
I just figured out something and have to ask if someone else has figured out the same issue before, as well.
If applying the !Update bang, all measures and meters of the skin are updated, excepting the measures which have set an UpdateDivider=-1 option. Obviously, if I add a !UpdateMeasure bang, the measure(s) in cause is/are updated, but are not by the !Update bang.
Example code:

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Variables]
Num=0

[MeasureCalc]
Measure=Calc
Formula=#Num#
DynamicVariables=1
UpdateDivider=-1

[MeterCalc]
Meter=STRING
MeasureName=MeasureCalc
X=0
Y=0
Padding=15,5,15,5
FontColor=220,220,220
FontEffectColor=0,0,0
StringEffect=Shadow
SolidColor=0,0,0,150
FontSize=8
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=Variable: #Num##CRLF#Measure: %1
LeftMouseUpAction=[!SetVariable Num "(1-#Num#)"][!Update]
DynamicVariables=1
UpateDivider=-1
As you can see, both, the [MeasureCalc] and the [MeterCalc] sections have an UpdateDivider=-1 option. When clicking the [MeterCalc] meter, the value of the Num variable is altered between 0 and 1. The [MeasureCalc] measure should follow this value. But although when you click, the Num variable is changing its value (this can be seen in the first line of the string), the measure doesn't follow this (as seen in the second line). If I remove the UpdateDivider=-1 option from the [MeasureCalc] measure, the measure is obviously updated properly. Even if the [MeterCalc] meter has the same UpdateDivider=-1 option, it doesn't seem to be affected by this problem: it is updated properly.
If I replace the [!Update] bang of the LeftMouseUpAction option of the [MeterCalc] meter by a [!UpdateMeasure "MeasureCalc"] (or even an [!UpdateMeasure *]), I get the measure updated correctly.
Is this something known?
Thank you in advance.
Yes, it is the expected behavior, because the !Update bang, according to the manual:
Overrides the setting of the Update option in [Rainmeter], immediately updates all measures and meters, and redraws the skin. This does not override any UpdateDivider options on measures or meters.
By the way, this will happen whatever value such an UpdateDivider has, as implied above (except maybe the default 1, which is the same as the skin Update). The slightly longer [!UpdateMeasure *][!UpdateMeter *][!Redraw] construct is your friend here, if you need updating everything and redrawing.

Spoiler: This is why I almost never use the plain !Update bang (and yes, it happened to me as well in my early Rainmeter days, hence my subsequent decision above). Don't worry, it's easy to overlook or forget this particularity of the bang after some time, if you don't take a decision like mine. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !Update not updating all measures

Post by balala »

Yincognito wrote: September 28th, 2023, 9:27 pm Yes, it is the expected behavior, because the !Update bang, according to the manual:



By the way, this will happen whatever value such an UpdateDivider has, as implied above (except maybe the default 1, which is the same as the skin Update). The slightly longer [!UpdateMeasure *][!UpdateMeter *][!Redraw] construct is your friend here, if you need updating everything and redrawing.
Yep, I indeed missed this detail, however there still is a question: if this applies to measures, why doesn't applies to meters as well? Because as said in my post, the meters having the UpdateDivider=-1 option are updated by the !Update bang, while measures having the same option, are not. Something is weird here, in my opinion.
Yincognito wrote: September 28th, 2023, 9:27 pm Spoiler: This is why I almost never use the plain !Update bang (and yes, it happened to me as well in my early Rainmeter days, hence my subsequent decision above). Don't worry, it's easy to overlook or forget this particularity of the bang after some time, if you don't take a decision like mine. :D
Alright, but my question is related to the fact that this might be a problem related to the !Update bang. I mean that if the bang updates the meter, but doesn't the measures with the same UpdateDivider option, this might be confusing.
User avatar
nek
Posts: 105
Joined: November 3rd, 2019, 12:00 am

Re: !Update not updating all measures

Post by nek »

You might be confused because of the typo UpdateDivider=-1 in the [MeterCalc] section.

I am learning how the Rainmeter skin works by creating a Update=-1 skin and seeing the Rainmeter > About > Log / Skins window.

Code: Select all

[Variables]
$=1.00

[Rainmeter]
Update=-1
; DefaultUpdateDivider=-1
AccurateText=1
OnRefreshAction=[!About]

[Calc]
Measure=Calc
Formula=Counter
OnUpdateAction=[!Log "#CURRENTSECTION# | Update" warning]

[Box]
Meter=Image
W=(80*#$#)
H=(80*#$#)
SolidColor=EDEADE
OnUpdateAction=[!Log "#CURRENTSECTION# | Update" warning]

[Text]
Meter=String
Y=(10*#$#)R
AntiAlias=1
FontFace=Segoe UI
FontSize=24
SolidColor=F5F5F5
Text=Something
OnUpdateAction=[!Log "#CURRENTSECTION# | Update" warning]
P.S. I don't use !Update bang at all in my skin code either.
I often use [!SetOption Meter OptionName OptionValue][!UpdateMeter Meter][!Redraw],
[!SetOption SectionName DynamicVariables 0][!UpdateMeasure/UpdateMeter SectionName]


Rainmeter Docs UpdateDivider option, !Update Bang
Forum topic How a skin is updated by jsmorley
User avatar
balala
Rainmeter Sage
Posts: 16176
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: !Update not updating all measures

Post by balala »

nek wrote: September 30th, 2023, 2:08 am You might be confused because of the typo UpdateDivider=-1 in the [MeterCalc] section.
Thank you for pointing this.
:? :o :?
OMG!!! You're perfectly right! What a stupid and extremely silly mistake from my part! I'm ashamed now.
Now I'm sorry I posted this.
If the meter has a CORRECT UpdateDivider=-1 option, it is not updated either.
nek wrote: September 30th, 2023, 2:08 am P.S. I don't use !Update bang at all in my skin code either.
As said to Yincognito as well, not this was the point. !Update is a perfectly valid bang and can be used. No one is asking you (or anyone) to use or not use certain bang. Who are using what is a matter of own choice of everyone. However I thought I found something at least weird on how the !Update bang is updating meters, but doesn't update measures, if both have the UpdateDivider=-1 option. But no, was just my carelessness. :?
User avatar
Yincognito
Rainmeter Sage
Posts: 7175
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: !Update not updating all measures

Post by Yincognito »

balala wrote: September 29th, 2023, 5:49 pm Yep, I indeed missed this detail, however there still is a question: if this applies to measures, why doesn't applies to meters as well? Because as said in my post, the meters having the UpdateDivider=-1 option are updated by the !Update bang, while measures having the same option, are not. Something is weird here, in my opinion.

Alright, but my question is related to the fact that this might be a problem related to the !Update bang. I mean that if the bang updates the meter, but doesn't the measures with the same UpdateDivider option, this might be confusing.
Well, the problem is solved by now thanks to nek's attention to detail. Don't worry, it happens - I didn't notice the typo either, since the post was all about the measure. :D
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth