[SOLVED] Change the font size on buttons and labels

Hi, I've just started a programme where I want to change the font size on the buttons and labels using a dictionary.
For the moment it works with this code.

What I'd like is to integrate everything into the same variable, as in this image.

I can't seem to make a loop to change the font size on the buttons and labels.
Thanks for your help.

A List of Pairs (component, fontsize) would be a better choice for this than a dictionary.
It allows use of the lookup in pairs block.

From my sample


OK, thanks for the list idea.
But how do you make a single list with buttons and labels?

like this

1 Like

buttons_and_labels.aia (2.9 KB)

I was not sure dictionaries allowed components as keys.

Yes, it is allowed. This works:

EDIT: And this also works...better:

thank you @Kevinkun


Thank you for your reply. I would like to do like this :

Your dictionary is backwards (left to right).

When doing any kind of lookup in a table or dictionary, the key for the lookup is in column 1 (a table for Lookup In Pairs) or in the first column of the Pairs.

Or rather like this:

I guess it's time to address your abuse of dictionary keys.

They are supposed to be unique, just like car keys and house keys.

(A major car manufacturer has gotten a bad reputation for car theft, when the thieves discovered the total number of unique car key combinations was very small, and they could use a small collection of keys to unlock all that manufacturer's cars.)

You have two key/value pairs in your dictionary with the same key value.

I am surprised that is even allowed at design time or run time.

Dictionary key/value pairs are supposed to return unique values from dictionary lookups.

Respect this common convention to avoid trouble.

Oh dear, yes, I made the rookie mistake.
The second image is wrong.
I hadn't paid attention to the identical key values.
It couldn't have worked.

Many thanks @Ramon
I've adopted your solution.
I can mix the components in the same list.

Everything works fine.

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