It is currently March 29th, 2024, 7:46 am

Measure not showing

Get help with creating, editing & fixing problems with skins
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Measure not showing

Post by Matth »

Hi

I'm kinda lost and don't know what I am doing wrong. It must be something small, yet I can't figure it out.

I have these measures and one meter. For some reason, I just can't get the Title being displayed though.

It displays the text "Test This" and the mouseover is also showing the description and date. Yet I cannot see the title, although in the About Rainmeter I can see the value in the MeaTitle1 measure.

What am I missing?

Code: Select all

[Rainmeter]
Update=1000
AccurateText=1

[Metadata]
Name=Hong Kong Weather
Author=Matthias Karl
Information=
License=Creative Commons BY-NC-SA 3.0
Version=1

[Variables]
Item=(?(?=.*<item>).*<item>.*<title>(.*)</title>.*<link>(.*)</link>.*<description>(.*)</description>.*<pubDate>(.*)</pubDate>)
Sub="^\s+":"","<![CDATA[":"","]]>":"","![CDATA[":"","]]":"","<br/>":""
vFontFace=Segoe UI
vFontColor=90, 138, 175, 255
vFontEffectColor=90, 138, 175, 28

[MeaWarning]
Measure=Plugin
Plugin=WebParser
Url=http://rss.weather.gov.hk/rss/WeatherWarningSummaryv2.xml
RegExp=(?siU)#Item#

[MeaTitle1]
Measure=Plugin
Plugin=WebParser
Url=[MeaWarning]
StringIndex=1
Substitute=#Sub#

[MeaLink1]
Measure=Plugin
Plugin=WebParser
Url=[MeaWarning]
RegExpSubstitute=1
StringIndex=2

[MeaDesc1]
Measure=Plugin
Plugin=WebParser
Url=[MeaWarning]
Substitute=#Sub#
StringIndex=3

[MeaDate1]
Measure=Plugin
Plugin=WebParser
Url=[MeaWarning]
StringIndex=4

;================================
;============ Meters ============
;================================

[MetTitle1]
Meter=String
MeasureName=MeaTitle1
MeasureName2=MeaDesc1
MeasureName3=MeaDate1
Text=Test This %1
FontFace=#vFontFace#
FontColor=#vFontColor#
FontSize=12
AntiAlias=1
LeftMouseUpAction=http://www.weather.gov.hk/textonly/v2/warning/detail.htm
ToolTipText=%2#CRLF#%3
DynamicVariables=1

mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Measure not showing

Post by mak_kawa »

In [MetTitle1], W= option is missing.
Matth
Posts: 54
Joined: May 17th, 2017, 8:43 am

Re: Measure not showing

Post by Matth »

Oh wow, thanks. So simple. I wasn't aware that you need to define the W parameter.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Measure not showing

Post by jsmorley »

Matth wrote:Oh wow, thanks. So simple. I wasn't aware that you need to define the W parameter.
You actually don't for String meters. 99% of the time you won't define W or H ahead of time, as with text that is coming dynamically from a measure, how can you know how wide it will / could be? W and H on String meters will generally only be used when you have a very fixed size you want for design purposes.

What is going on here is that with a String meter based on a WebParser measure, on the first update the value of the measure, and thus the string displayed by the meter is "" or an empty string. If you don't have something, either the W and H on the String meter, some appropriately sized background Image meter, or an explicitly set SkinWidth and SkinHeight set in [Rainmeter], then the skin will be created with no width or height and will never change.

Rainmeter doesn't wait around for a WebParser measure to finish trudging out to the internet and retrieving data. It carries on with its work, and when the WebParser measure is done, Rainmeter will get and use the result. On the very first skin update, that means that the value of a WebParser measure will always be "" or an empty string.

The BEST way to handle this, or at least the easiest, is to simply use DynamicWindowSize=1 in the [Rainmeter] section of your skin.

https://docs.rainmeter.net/manual/skins/rainmeter-section/#DynamicWindowSize

Unsolicited aside:

What I do is just ALWAYS use this as a template for the [Rainmeter] section of a new skin.

Code: Select all

[Rainmeter]
Update=1000
DynamicWindowSize=1
AccurateText=1