Hello!
I'm working on my skinfile and I have following qustion:
I want to select the weatherbutton and display the weather. Then if the Clockbutton is pressed, the weatherbutton should get deselected and the weather should be closed. Does anybody have an Idea how I can realize this? I use V 0.98.
Not sure if it is possible in 0.98, but you would need to use an IF statement.
Something similar to this
if,region,1,0
imagebutton,226,2,weather active.png,t,1,4,999,-1
else
imagebutton,226,2,weather.png,t,1,4,0,-1
endif
Obviously you would need to adjust the regions to what ever you are using. Hope it works
This is not the problem I mean, I want to deselect the weather region & weather button when the clock button is pressed....
I tried much if...statements, but don't find a solution.
Drumbo was mostly right.
In order to deselect the weather button you do need an if...else like the one described. Also, however, you need a button command on the clock button. Something like:
if,region,1,0
imagebutton,226,2,weather active.png,t,1,4,999,-1
else
imagebutton,226,2,weather.png,t,1,4,0,-1
button,226,2,11,11,2,4,999,
endif
if,region,2,0
imagebutton,212,2,clock active.png,t,2,4,999,-1
else
imagebutton,212,2,clock.png,t,2,4,0,-1
button,212,2,11,11,1,4,999,
endif
The button command instructs TodayPlus to switch region 1 (weather) to page 999 (ie hidden).
Obviously you need to change the region/page numbers above - I've used region 2 for clocks, but that probably isn't right.
EDIT: Amended code to correct x coordinate on first button command. Thanks to sop for pointing out the error.
Thx for answer, but this doesn't solve my problem.
The config.txt and the sliders.txt which came with the installaion display's the weather and underneath the clock. But what I will is, that if the weather is displayed and the clock-button will be pressed, the weather will be closed and the clock will be displayed. also it shoud work viceversa. I tried it with the button command, but this doesn't work like i want.
Quote from: CookieBut what I will is, that if the weather is displayed and the clock-button will be pressed, the weather will be closed and the clock will be displayed. also it shoud work viceversa. I tried it with the button command, but this doesn't work like i want.
Strange, as that is exactly what the code I posted does. Are you sure you got the region numbers correct in the button command? It's easy to make a mistake.
I wanted to do the same. So I tried your code.
I think it may work, when the button command in line 5 is:
button,226,...
Quote from: sopI wanted to do the same. So I tried your code.
I think it may work, when the button command in line 5 is:
button,226,...
Blech... you're right. Sorry all for my typo - as ever, I typed it from my head rather than trying it out. Code should be:
if,region,1,0
imagebutton,226,2,weather active.png,t,1,4,999,-1
else
imagebutton,226,2,weather.png,t,1,4,0,-1
button,226,2,11,11,2,4,999,
endif
if,region,2,0
imagebutton,212,2,clock active.png,t,2,4,999,-1
else
imagebutton,212,2,clock.png,t,2,4,0,-1
button,212,2,11,11,1,4,999,
endifI will edit my previous post also, to make sure people don't copy the wrong one.