Sounds fine, but what sort of window are you adding it to? Maybe the parent comp isn’t visible, or the box is off the edge, or covered by another component or something?
What I want to do is add a text box to the page and then grab the current text in the box when I click a button. When I try to get to the text inside the button’s click() function I can’t do it.
You don’t need to grab it in the button’s click function.
I presume your component has the button and text editor as members.
Your component should be a ButtonListener (to recieve click messages from the button), and registered with the button via myButton->addButtonListener(this) in your component’s constructor.
You then have a buttonClicked (Button* b) function to implement, in which you test that it was that button [ if (b == myButton) { … } ] and then do what you want from there, e.g. doStuffWith (myEditor->getText ());
You likely don’t want to be using addToDesktop either… you should be using something like a DialogWindow or DocumentWindow if you want to have it appear on the desktop (or perhaps even just using an AlertWindow subclass).
what is it that you want to actually do? do you have a sketch of how you want it to look?
Have you tried using the jucer to create the component with the text box and button on there? That’s an easier way to start off than doing it all by hand.