question regarding LookAndFeel::positionComboBoxText


#1

Jules,

I’m confused by some code in void LookAndFeel::positionComboBoxText

    label.setBounds (1, 1,
                     box.getWidth() + 3 - box.getHeight(),
                     box.getHeight() - 2);

what is the subtraction of box.getHeight() in the width calculation?


#2

Sorry, that’s not very clearly written! It’s just the distance it leaves at the end of the box, for the drop-down button. The button is square, so its width is the same as the box’s height.


#3

Aha! Thanks… :slight_smile: