I need some help for making it more optimize

Hello so, I am making a block where tinydb is mostly used for loading the color, the tinydb tag "mode" is to check, if tinydb "mode" = 1 it means in light mode. if 0 it will output for darkmode version.

I have hard time optimizing since the buton to label 1. Since i have to do 30 labels, and each of the have different tag in their save db, (what I meant is ex: label 1 = tinydb tag = C1, label 2 = tinydb tag = C2 etc..). Is there anyway to make it more optimize? please and thank you, and also ask me anything if you are confused bout what I said or meant!

blocks(1)|492x500

Use the everyLabel block, which provides a list of all your labels, you can then iterate over this list, using property setters from the anyLabel component blocks.

Hey do you mind giving me an example? I'm a bit of a beginner and I kind of dont understand how to use list for everyLabel block

Something like this:

If you have some labels you do not want to change, put them in a list and test

I see alrighttt thank you. but theres one bit problem.

So in my project, each Label have a different tinydb save file where each of the were save in different tag. Ex : Label 1 is save in tag "C1", Label 2 is save in tag "C2", Lavel 3 is save in tag "C3", and etc... Is there anyway to optimize that using list?

Oh yeah fyi that each label save in tag are the backgroundcolors.

hmmm, buttons not labels...

Probably the best thing to do is to turn all those blocks into a procedure that will apply to any button

I seee, alrightt that's what I needed, thank you so much tim for your help :wink:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.