There is something very obvious that I am missing, but I've been staring at this for half an hour now!
I have an extremely simple skin. I just want to display a small image (hidden at first), and toggle it on and off with a mouse click. I've drawn a small shape, and I figured I'd use that as the toggle button. But, my code below never changes the value of #HideImage#.
Lieuallen wrote: ↑August 3rd, 2020, 4:48 pm
There is something very obvious that I am missing, but I've been staring at this for half an hour now!
I have an extremely simple skin. I just want to display a small image (hidden at first), and toggle it on and off with a mouse click. I've drawn a small shape, and I figured I'd use that as the toggle button. But, my code below never changes the value of #HideImage#.
You don't want to [!Refresh], that reloads the skin and starts over, and #HideImage# is back to "1". You can just [!UpdateMeter *][!Redraw] or even just [!Update].
If you really need to do a [!Refresh] there for some reason, you are going to want to "write" the value of #HideImage# to the file, so it is the "toggled" state when the skin is refreshed.
Removing the [!Refresh] does (of course) let the variable toggle. I'm pretty new, but geez -- I should have realized that!
The other little boo-boo was not including DynamicVariables=1 in the Image's meter. So even though the variable was changing, the meter wasn't using the new value!
Anyway, all's well that ends well! Thanks for the help!
Last edited by Lieuallen on August 3rd, 2020, 5:32 pm, edited 1 time in total.
Lieuallen wrote: ↑August 3rd, 2020, 5:22 pm
I originally had a [!Redraw], but when that didn't work, I switched it to [!Refresh]. But I do now see that that won't work, since it restarts the entire skin, resetting #HideImage# to one.
Unfortunately, neither [!Update] nor [!UpdateMeter *][!Redraw] works for me.
What I'm seeing is through the Rainmeter Log. In this skin, I see HideImage listed as the only variable. It is 1, and no matter how many times I click the shape, it stays 1. So it seems my SetVariable bang isn't working, or isn't triggered.
I should note that my cursor does change to the "hand" when I'm hovering over the shape, so it sure seems like it should work! But, as I said, HideImage stays set at 1 no matter what I do. If I define HideImage as 0 in the initital [Variables] section, then it instead stays stuck at zero. I can't seem to toggle it....
I've read the documentation, and it discusses that you must click on a "solid" part of a shape for the mouse actions to trigger. My shape is really small, but I'm pretty sure that I'm clicking on it (evidenced by the "hand" cursor).
Ah, You don't have HideImage defined in a [Variables] section of your skin. So it's not a variable.
Kinda embarrassing -- I actually DO have the [Variables] section. But when I cut out the [Metadata] section for brevity, I accidentally deleted that line as well!
Anyway, as I said, I've got it working now. Thanks!!
Lieuallen wrote: ↑August 3rd, 2020, 5:33 pm
Kinda embarrassing -- I actually DO have the [Variables] section. But when I cut out the [Metadata] section for brevity, I accidentally deleted that line as well!
Anyway, as I said, I've got it working now. Thanks!!