It is currently April 24th, 2024, 10:21 pm

IfMatch Help

Get help with creating, editing & fixing problems with skins
Chrollo
Posts: 2
Joined: September 29th, 2019, 1:07 am

IfMatch Help

Post by Chrollo »

[MeasureIsFullScreen]
Measure=Plugin
Plugin=IsFullScreen
IfCondition=MeasureIsFullScreen=1
IfTrueAction=[!UpdateMeter *][!Redraw]
IfFalseAction=[!UpdateMeter *][!Redraw]
IfMatch=^$
IfMatchAction=[!UpdateMeter *][!Redraw]
IfNotMatchAction=[!SetOption ComputerTXT Text [MeasureIsFullScreen]][!UpdateMeter *][!Redraw]

I want this plugin to update the value changes. However, it only updates when the IfMatch changes. For example:
Match: Update
Match: Wont update
NotMatch: Update
Match: Update
User avatar
jsmorley
Developer
Posts: 22629
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: IfMatch Help

Post by jsmorley »

I don't really follow. The IfTrueAction and IfFalseAction and IfMatchAction options don't really do anything do they? The skin is going to update all meters and redraw on every skin update in any case. Not sure I see the point in hammering the skin with an extra update and redraw like that, when you aren't changing anything.

The only time the Text option is set is the first time that the IfNotMatchAction is fired. This will be when the match changes from true to false. It won't be fired again until the match changes to true, and then back again to false.

If you want the IfNotMatchAction to be fired on every update of the measure, you can add IfMatchMode=1 to the measure.

https://docs.rainmeter.net/manual/measures/general-options/ifmatchactions/#IfMatchMode

Just be sure that you want this action to take place on EVERY update of the measure, as long as the match is, or remains, false. And in this case, I would CERTAINLY remove those pointless empty updates, as you absolutely don't want those happening on every update of the measure.
Chrollo
Posts: 2
Joined: September 29th, 2019, 1:07 am

Re: IfMatch Help

Post by Chrollo »

Thank you very much. Actually, i'm trying to make a mac menubar. If the user click it and the application name changed, there would be a visual error which the menu won't stick in the right place. So i'm trying to avoid change when the menubar is focused.
Thanks again
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: IfMatch Help

Post by balala »

jsmorley wrote: September 29th, 2019, 1:25 am The skin is going to update all meters and redraw on every skin update in any case. Not sure I see the point in hammering the skin with an extra update and redraw like that, when you aren't changing anything.
In fact simply updating the meters and redrawing the skin doesn't make too much sense, in my opinion. Updating the meters makes sense if there somethings are changing, eg by using a !SetVariable or a !SetOption bang. Otherwise...