It is currently March 28th, 2024, 8:59 pm

Question on setting keys in Rainmeter section from another skin

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7027
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Question on setting keys in Rainmeter section from another skin

Post by Yincognito »

I'm currently working on a tooltip skin (yeah, I know, why should I even bother?) and while everything works well so far, one of the tasks I accomplish in my parent skin (the skin where the tooltip skin is called from) is setting the width and the height of the tooltip skin from corresponding parent skin variables - since every parent skin has a different amount of info that passes to the tooltip skin.

The thing is, I was wondering if a set of bangs like [!WriteKeyValue Rainmeter SkinWidth #TooltipWidth# "#ROOTCONFIGPATH#Tooltip\Tooltip.ini"][!WriteKeyValue Rainmeter SkinHeight #TooltipHeight# "#ROOTCONFIGPATH#Tooltip\Tooltip.ini"] is my only option to do this, or is there another way (like some !SetVariable bangs, maybe?) ... since the SkinWidth and SkinHeight options belong to the Rainmeter section, and as far as I understood from the manual, it is not dynamic (meaning it likes hardcoded key values writable with !WriteKeyValue bangs and hates setting it using variables that are subject to change).

I'm asking this because I already tried setting variables like #SkinWidth# and #SkinHeight# in the Variables section of the tooltip skin, but when I attempted to set those variables from the parent skin in order to be read by the following SkinWidth=#SkinWidth# SkinHeight=#SkinHeight# from the Rainmeter section in the tooltip skin, it didn't work. The !WriteKeyValue method worked as a "workaround", but I would like to minimize writing to disk if possible.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Jeff
Posts: 326
Joined: September 3rd, 2018, 11:18 am

Re: Question on setting keys in Rainmeter section from another skin

Post by Jeff »

I have no idea if this will work but try having your skin Update to -1 and do a [!Update] bang after changing the Tooltip skin/meter thing
I also have no idea why it works but SkinHeigh and SkinWidth do accept variables, you can do !SetVariable to change them. I suppose variables do work in [Rainmeter], but you probably got confused by the DynamicVariables section on the docs, only variables that are [LikeThis] do not work in the sections linked in the doc, everything else should work though
I think only stuff that's in the Skin bangs works in [Rainmeter], so good luck with that
Though, why not use the actual Tooltip option? If you wanna do some extra stuff on it like adding your own effects I understand but if not, don't complicate yourself
User avatar
Yincognito
Rainmeter Sage
Posts: 7027
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Question on setting keys in Rainmeter section from another skin

Post by Yincognito »

Jeff wrote: December 25th, 2018, 2:29 am I have no idea if this will work but try having your skin Update to -1 and do a [!Update] bang after changing the Tooltip skin/meter thing
I also have no idea why it works but SkinHeigh and SkinWidth do accept variables, you can do !SetVariable to change them. I suppose variables do work in [Rainmeter], but you probably got confused by the DynamicVariables section on the docs, only variables that are [LikeThis] do not work in the sections linked in the doc, everything else should work though
I think only stuff that's in the Skin bangs works in [Rainmeter], so good luck with that
Well, I doubt that I got confused by the manual on this, it's pretty straight-forward on it. I've also used #LikeThis# variables (this has nothing to do with [LikeThis] section variables, I use only plain variables) in the [Rainmeter] section without any issue, but they were usually based on more or less hardcoded / formula based values defined elsewhere (typically in the Variables.inc file). The thing is, when setting SkinHeigh and SkinWidth from the parent skin, it involves the change of #SkinWidth# and #SkinHeight# variables from their initial value at the moment of actually loading the skin using the !ActivateConfig bang ... and it's this that turns them into dynamic variables (aka variables that change at runtime), IMHO - and those are not supported in the [Rainmeter] section, according to the manual.
Jeff wrote: December 25th, 2018, 2:29 amThough, why not use the actual Tooltip option? If you wanna do some extra stuff on it like adding your own effects I understand but if not, don't complicate yourself
Yeah, this is why I thought about designing a tooltip skin, for the effects. I'm already using classic tooltips in my skins and they work well, but it's a nightmare to align text, autoscale values, or basically making them look "good". I had to use lots of tricks for some basic "alignment" and autoscale in classic tooltips, and it usually involves adding specific spaces befor or after values or using complex formulas to autoscale them. Sure, making a tooltip skin involves similar effort, but maybe the result is worth it. If not, I'll just revert back to the classic tooltip methods.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Question on setting keys in Rainmeter section from another skin

Post by balala »

Jeff wrote: December 25th, 2018, 2:29 am but SkinHeigh and SkinWidth do accept variables, you can do !SetVariable to change them.
No, you can't. Variables can be used into [Rainmeter] section, but you can't modify them, nor with !SetVariable, nor with !SetOption. By definition, this section can't be dynamically modified (Note here).
Section variables seem to can be used here, in some circumstances, though (which seems weird to me, but...).
So, finally writing the appropriate values through some !WriteKeyValue bangs is the only method, but take care, when you do so, you have to refresh the skin (probably using a !Refresh bang).