It is currently April 27th, 2024, 11:34 pm

Error log - Resizable clock

Get help with creating, editing & fixing problems with skins
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Error log - Resizable clock

Post by Nookz »

I've been trying to make a simple resizeable Clock and I think I managed to make it work using the mouse plugin altho maybe a bit clunky still, but it works..kinda

In practice it works, but it is throwing a ton of errors with weird characters when its doing the resizing..
Screenshot 2023-11-22 195514.png
Sometime, if I have the ini file open, it''ll even write the KeyVariables inside its own ini file instead of the Variables.inc. It'll have the whole formula instead of the result and all kind of messed up characters in it..

I feel I did something terribly wrong, but looking at the code I can't find anything. nothing obvious to a newbie like me at least..
Clock_.rmskin
[SettingsCheck] and [Settings] are related to a general settings window I'm using, but it really shouldn't affect the rest of the code either way.. (I could always include it if needed)
If anyone has the chance to take a look and maybe point me my mistake(s), that'll be greatly appreciated.

in the meantime a quick preview of some of what I have for the rest of skin so far, to make me feel better. :D
Screenshot 2023-11-22 211736.png
You do not have the required permissions to view the files attached to this post.
Last edited by Nookz on November 23rd, 2023, 4:25 am, edited 3 times in total.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5407
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Error log - Resizable clock

Post by eclectic-tech »

I am not seeing those errors in the log, but you have a "typo" in the 'Format=' line of the [Time] measure section in the 'ClockMini.ini'...
Format=%#24#H%M should be Format=%#24#:%M
After creating a @Variables.inc file with the required skin variables, the resizing seems to be working close to the way you intended when middle-click the skin.
resize.png
Resized
resize2.png

You may want to make sure you encode all of your skins as UTF-16 LE Bom so any Unicode characters are correctly displayed.
You do not have the required permissions to view the files attached to this post.
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: Error log - Resizable clock

Post by Nookz »

Ah good catch. I was using H instead of : at first, but switched it and forgot to modify the Mini version.
But I think I didn't explain my issue clearly enough.

The skin has two 'mode'. a compact one and a normal one. ClockMini is the compact one and is not meant to be resized.
The regular version of the clock skin is suppose to be resizeable on its own. If you right click the clock, a icon should appear at the bottom right and you can click&drag that to resize the skin. That is what is throwing the errors.

The middle click opens up a 'setting window' that is actually a seperate skin I use for all the other gadget skins as well.
And double left click should switch between Normal and Compact mode.

Edit:
I realize that It might be hard to figure out with a lot of those pieces missing so I updated the first post .rmskin to include everything that should be necessary to run the skin with everything that is included in its code. Please let me know if that's not the case.
Altho now the file is much larger since it include the settings skin and also my color selector skin..

I also don't think it has to do with special characters as I'm not using them. The ones that appears in the log are nowhere in the code. it's like it read the path the Variables.inc file wrong when I'm resizing 'too fast'.
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Error log - Resizable clock

Post by Yincognito »

Nookz wrote: November 23rd, 2023, 3:50 am Edit:
I realize that It might be hard to figure out with a lot of those pieces missing so I updated the first post .rmskin to include everything that should be necessary to run the skin with everything that is included in its code. Please let me know if that's not the case.
Altho now the file is much larger since it include the settings skin and also my color selector skin..

I also don't think it has to do with special characters as I'm not using them. The ones that appears in the log are nowhere in the code. it's like it read the path the Variables.inc file wrong when I'm resizing 'too fast'.
I don't believe it's hard to figure it out. The errors you get due to the bangs in LeftMouseDragAction from [ResizeMouse] in Clock.ini are mostly because:
1) the $MouseX$ and similar are valid only in the context of a mouse action like click, scroll and in this case probably drag, so I would first set some variables to those $MouseX$ and such values once, then use them going forward in that bang chain (i.e. without referencing $MouseX$ and related again, on that line, somewhat similar to how $InputText$ works in an InputText measure), however, see below...
2) to use the NEW (as in not OLD) value of a just changed variable in the SAME chain of bangs where the said change happens, you MUST use the nested syntax for variables:
https://docs.rainmeter.net/manual/variables/nesting-variables/

In other words, it should be like:

Code: Select all

[!SetVariable MouseX $MouseX$][!SetVariable ClockWidth ([#MouseX]+...)][!SetVariable SomeOtherValue ([#ClockWidth]+...)]...
You get the idea. This is untested and written from my phone, but it should get you closer to an error free behavior regardless, assuming everything else in those formulas is correct.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: Error log - Resizable clock

Post by Nookz »

Yin coming in with the easy solution, again. That absolutely fixed it.
Big thks!!

Just one additional question. I've been using the plugin mostly for bars before this 'resizing' test and never had to do that 'workaround', or at least I don't think I ever noticed it throwing those kind of errors in any of the other instances I've used the $MouseX$/$MouseY$. Do you suggest I go back and change all those to this format, just to make sure it's error free? Or it is something special with the resizing that might be causing it? (Like maybe the fact that when the dragging happens, the mouse is mostly outside of the skin maybe?)
User avatar
Yincognito
Rainmeter Sage
Posts: 7178
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Error log - Resizable clock

Post by Yincognito »

Nookz wrote: November 23rd, 2023, 5:08 pm Yin coming in with the easy solution, again. That absolutely fixed it.
Big thks!!

Just one additional question. I've been using the plugin mostly for bars before this 'resizing' test and never had to do that 'workaround', or at least I don't think I ever noticed it throwing those kind of errors in any of the other instances I've used the $MouseX$/$MouseY$. Do you suggest I go back and change all those to this format, just to make sure it's error free? Or it is something special with the resizing that might be causing it? (Like maybe the fact that when the dragging happens, the mouse is mostly outside of the skin maybe?)
No problem, glad to help in fixing the issue. Providing solutions is easy, though not always easy solutions, if you know what I mean... ;-)

I see no reason in rewrite stuff that supposedly already works IF it's not throwing errors in the first place. To be clear, 1) was more like I would approach things given the length of that bang chain and possibly not the cause for the errors, while 2) was mandatory anyway given that you were using those changed variable values in the same option / line. I did not test the code to see which one of these two suggestions was the actual culprit, and although normally your suspicion regarding the mouse being outside of the skin is mostly logical, I don't think it was the cause for the errors, otherwise similar skins like the one you already saw here would have thrown errors too - even after doing 1) and 2), by the way, if the mouse location was indeed at fault. Maybe you noticed that I followed the same 1) and 2) guidelines there as well.
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
Nookz
Posts: 55
Joined: November 3rd, 2023, 7:22 pm

Re: Error log - Resizable clock

Post by Nookz »

well, that was really useful information either way. I actually ended up having similar issues with others things that same day and you solution/explanations really saved me. So thks again!