It is currently September 24th, 2020, 5:07 am

One Meter Updates !OnChangAction but another does not [solved]

Help with creating, editing & fixing problems with skins
dvo
Posts: 973
Joined: February 7th, 2016, 6:08 am

Re: One Meter Updates !OnChangAction but another does not [solved]

Post by dvo »

nice glad it's working now:P
User avatar
Yincognito
Posts: 2593
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: One Meter Updates !OnChangAction but another does not

Post by Yincognito »

CodeCode wrote: September 13th, 2020, 6:23 am I got it working by adding another measure where the !Refresh works correctly.

Code: Select all

;New Measure
[MeasureIP]
Measure=Plugin
Plugin=SysInfo
SysInfoType=IP_ADDRESS
SysInfoData=Best
OnChangeAction=[!Refresh]
DynamicVariables=1

;Same Text Meter
[MeterWANIP]
Meter=String
MeasureName=MeasureWANIP
X=165
Y=132
StringAlign=Center
FontColor=#ColorZ#
StringEffect=Border
FontEffectColor=0,0,0,255
FontSize=18
FontFace=#Font#
AntiAlias=1
MouseOverAction=[!SetOption MeterWANIP FontColor 210,170,90,220][!Redraw]
LeftMouseDownAction=["C:\Program Files\Private Internet Access\pia-client.exe"]
Text=%1
DynamicVariables=1
Group=IPN
You don't need !Refresh, you don't need OnChangeAction, you don't need any of that. In your previous code using an WebParser measure, you only needed to add a [!CommandMeasure MeasureWANIP "Update"] (followed by updating and redrawing the necessary meters, of course) wherever you wanted to update the IP (e.g. on mouse hover, on mouse click, etc). In the current code, there's no need for OnChangeAction=[!Refresh] in the measure, it should update automatically, assuming you actually reference the [MeasureIP] measure in a meter (right now [MeterWANIP] still links to the "old" MeasureWANIP measure, instead of the "new" MeasureIP). Even if it didn't update automatically, an [!UpdateMeasure MeasureIP][!UpdateMeter TheMeterThatLinksToMeasureIP][!Redraw] would have done the job.