It is currently April 19th, 2024, 10:47 pm

Toggle 2 icon pics back and forth

Get help with creating, editing & fixing problems with skins
User avatar
bluecrosser
Posts: 7
Joined: August 19th, 2020, 9:43 am

Toggle 2 icon pics back and forth

Post 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
You do not have the required permissions to view the files attached to this post.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Toggle 2 icon pics back and forth

Post 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
User avatar
bluecrosser
Posts: 7
Joined: August 19th, 2020, 9:43 am

Re: Toggle 2 icon pics back and forth

Post by bluecrosser »

Thank you for responding :)

As is I can't get anything to display. Is my directory correct?
Directory.PNG
Directory2.PNG
You do not have the required permissions to view the files attached to this post.
User avatar
bluecrosser
Posts: 7
Joined: August 19th, 2020, 9:43 am

Re: Toggle 2 icon pics back and forth

Post 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
You do not have the required permissions to view the files attached to this post.
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Toggle 2 icon pics back and forth

Post 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.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Toggle 2 icon pics back and forth

Post 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#
User avatar
bluecrosser
Posts: 7
Joined: August 19th, 2020, 9:43 am

Re: Toggle 2 icon pics back and forth

Post by bluecrosser »

Cool, both of those work. Thanks guys. Ill post a pic when I have it all setup how I want.
User avatar
bluecrosser
Posts: 7
Joined: August 19th, 2020, 9:43 am

Re: Toggle 2 icon pics back and forth

Post 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
You do not have the required permissions to view the files attached to this post.
mak_kawa
Posts: 908
Joined: December 30th, 2015, 9:47 am

Re: Toggle 2 icon pics back and forth

Post by mak_kawa »

Hi bluecrosser

Congrats, indeed. :-)
User avatar
balala
Rainmeter Sage
Posts: 16147
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Toggle 2 icon pics back and forth

Post 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.