how I can change the text size(font) in ListBox? CP5

edited August 2015 in Library Questions

Hi, I'm trying to resize the text in a ListBox. I managed to do it with the big box ("Big Size"). But I've tried several things and I can not change the other box ("small size"). Here's the code:

        import controlP5.*;

        ControlP5 cp5;

        ListBox l;

        int cnt = 0;

        void setup() {
          size(700, 400);

          ControlP5.printPublicMethodsFor(ListBox.class);

          cp5 = new ControlP5(this);
          l = cp5.addListBox("myList")
                 .setPosition(100, 100)
                 .setSize(320, 220)
                 .setItemHeight(35)

                 .setBarHeight(35)
                 .setColorBackground(color(255, 128))
                 .setColorActive(color(0))
                 .setColorForeground(color(255, 100,0));

                 int SIZE = 12;
          PFont fonst = createFont("Arial",30,true);
          ControlFont font = new ControlFont(fonst,SIZE*2);
          l.captionLabel().toUpperCase(false).setFont(font);
          l.captionLabel().set("Big Size").setFont(font);
          l.captionLabel().setColor(0x33330000).setFixedSize(false);
          l.captionLabel().style().marginTop = 3;
          l.valueLabel().style().marginTop = 3;
          String [] A = {"small size"};
          ListBox lbi = l.addItems(A);
        lbi.setColorBackground(0x99990000);lbi.valueLabel().toUpperCase(false).setFont(font).style().marginTop = 3;//l.captionLabel().se// toUpperCase(false).setFont(font);

        }

        void draw() {}

greetings and thanks advance

Answers

Sign In or Register to comment.