I read through the tutorial here ( http://code.google.com/p/juced/wiki/JuceTutorial ) but it seems to be very very out of date, so i’m not sure how much of it is still applicable.
I’m trying to write a “hello world” app so to speak, and I want to make a button and a text label.
I’m able to compile my app and get either a button or a text label to appear in the window, but not both. I think this is because the second ui element I am declaring is being rendered on top of the other one because I am not setting its size correctly. I’ve tried using setBounds, and setBoundsRelative, but neither appear to have any effect on the rendered element.
When I only render a button, the button stretches to fit the entire window. When I resize said window, it resizes as well and fills up the entire thing.
Here’s the code in my MainWindow.cpp (not sure if it’s relevant but I’m using mac os 10.6.8 and xcode to compile.)
This file was auto-generated by the Jucer! It contains the basic outline for a simple desktop window.
: DocumentWindow (JUCEApplication::getInstance()->getApplicationName(),
TextButton *button1 = new TextButton (T(“Hello world!”));
button1->setBoundsRelative(0.2f, 0.2f, 0.5f, 0.5f);
setContentOwned (button1, false);
centreWithSize (320, 480); setVisible (true);
Thanks in advance for any insight you guys can lend.