Why does this code placed in the main component constructor not work?
LoadComponent1 = new LoadComponent; addAndMakeVisible (LoadComponent1); int Width = LoadComponent1 -> getParentWidth (); DBG (T("Width is ") + String (Width)); int Height = LoadComponent1 -> getParentHeight (); DBG (T("Height is ") + String (Height)); LoadComponent1 -> setSize (200, 300); LoadComponent1 -> setTopRightPosition (Width - 10, Height - 10);
Width and Height return 0…
I can get LoadComponent1 to display if I use absolute values for width and height
I have also tried using the MainComponent members getWidth and getHeight in the constructor but they also return 0
The only place I have found that they return the size of the MainComponent is in the paint member
What is going on here?