ControlP5 adjust tab's width after changing the font (version 0.5.7)
in
Contributed Library Questions
•
1 year ago
Hi everyone!
The problem is after changing font and the font size for the tab, the tab's width does not change according to label length and font size.
I'm trying to "resize" the tab's width after setting the font size. I've tried something like this:
- import controlP5.*;
- ControlP5 control;
- Tab resume;
- Tab scenario;
- void setup() {
- size (800, 200);
- control = new ControlP5(this);
- resume = control.getTab("default");
- resume.activateEvent(true);
- resume.setColorActive(color(150, 150, 150));
- resume.captionLabel().setControlFont(createFont("impact", 20, true));
- resume.captionLabel().style().marginTop = 3;
- resume.setHeight(30);
- resume.setLabel("Resume12345");
- scenario = control.addTab("Scenario");
- scenario.activateEvent(true);
- scenario.setColorActive(color(150, 150, 150));
- scenario.captionLabel().setControlFont(createFont("impact", 20, true));
- scenario.captionLabel().style().marginTop = 3;
- scenario.setHeight(30);
- scenario.setLabel("Scenario12345");
- }
- void draw() {
- }
Any ideas?
Thanks in advance,
Diana
1