Page 1 of 1

Toggle 2 icon pics back and forth

Posted: August 19th, 2020, 10:02 am
by bluecrosser
Hello, I'm a new Rainmeter user. Everything I found was way over my head so any help is appreciated.

I basically just want a small icon picture 47 x 47 pixels to toggle between the original picture and then a copy of that picture with a check mark when clicked so my son can keep track of the assignments hes finished in his apps each day.
todo.PNG
todochk.png

Re: Toggle 2 icon pics back and forth

Posted: August 19th, 2020, 10:15 am
by mak_kawa
Hi bluecrosser

How about this?

Code: Select all

[Rainmeter]
Update=1000

[Variables]
ImageNum=0
Image0=todo.png
Image1=todochk.png

[meterTodo]
Meter=Image
ImageName=[#Image[#ImageNum]]
X=0
Y=0
W=47
H=47
LeftMouseUpAction=[!SetVariable ImageNum (1-#ImageNum#)][!UpdateMeter meterTodo][!Redraw]
DynamicVariables=1

Re: Toggle 2 icon pics back and forth

Posted: August 19th, 2020, 5:03 pm
by bluecrosser
Thank you for responding :)

As is I can't get anything to display. Is my directory correct?
Directory.PNG
Directory2.PNG

Re: Toggle 2 icon pics back and forth

Posted: August 19th, 2020, 5:25 pm
by bluecrosser
This seems to work with the pictures in the folder with the ini file.

Guess I didn't need all those other folders but I always see them in other peoples skin folders. Thanks for the help I think I can do what I need with this. :welcome:
Directory3.PNG

Re: Toggle 2 icon pics back and forth

Posted: August 19th, 2020, 6:42 pm
by balala
bluecrosser wrote: August 19th, 2020, 5:25 pm This seems to work with the pictures in the folder with the ini file.

Guess I didn't need all those other folders but I always see them in other peoples skin folders. Thanks for the help I think I can do what I need with this. :welcome:
Recommend to use the images from the @Resources\Images folder, where they initially have been. Move them back into this folder and modify the Image0 and Image1 variables into the [Variables] section as it follows: Image0=#@#Images\todo.png and Image1=#@#Images\todochk.png. Then apply mak_kawa's solution.

Re: Toggle 2 icon pics back and forth

Posted: August 19th, 2020, 7:46 pm
by mak_kawa
Hi bluecrosser

Sorry... I have missed @Resources folder. Please follow balala's post, it is a recommended way. For compensation, :-) I offer an alternative code which doesn't use "fussy" nested variable.

Code: Select all

[Rainmeter]
Update=1000

[Variables]
HiddenFlag=1

[meterTodo]
Meter=Image
ImageName=#@#Images\todo.png
X=0
Y=0
W=47
H=47
LeftMouseUpAction=[!SetVariable HiddenFlag (1-#HiddenFlag#)][!UpdateMeter meterTodo][!UpdateMeter meterTodoChk][!Redraw]
DynamicVariables=1
Hidden=(1-#HiddenFlag#)

[meterTodoChk]
Meter=Image
ImageName=#@#Images\todochk.png
X=0
Y=0
W=47
H=47
LeftMouseUpAction=[!SetVariable HiddenFlag (1-#HiddenFlag#)][!UpdateMeter meterTodo][!UpdateMeter meterTodoChk][!Redraw]
DynamicVariables=1
Hidden=#HiddenFlag#

Re: Toggle 2 icon pics back and forth

Posted: August 19th, 2020, 11:55 pm
by bluecrosser
Cool, both of those work. Thanks guys. Ill post a pic when I have it all setup how I want.

Re: Toggle 2 icon pics back and forth

Posted: August 20th, 2020, 7:17 am
by bluecrosser
Now my kid can stop arguing with me about what lesson to do next. He can choose his schoolwork as long as everything gets a check.
Thanks for the help, it was the perfect difficulty to start getting into Rainmeter.
Desktop.PNG

Re: Toggle 2 icon pics back and forth

Posted: August 20th, 2020, 7:37 am
by mak_kawa
Hi bluecrosser

Congrats, indeed. :-)

Re: Toggle 2 icon pics back and forth

Posted: August 20th, 2020, 7:17 pm
by balala
bluecrosser wrote: August 20th, 2020, 7:17 am Thanks for the help, it was the perfect difficulty to start getting into Rainmeter.
It'll become easier and easier, if you keep working.
Glad you got it working.