MainWindow :: MainWindow()
: DocumentWindow (T("Hello World"),
Colours::lightgrey,
DocumentWindow::allButtons,
true)
when I work with Jucer?
Jucer deleted
: DocumentWindow (T("Hello World"),
Colours::lightgrey,
DocumentWindow::allButtons,
true)
when I save file!
if you look at the header file generated, it states:
Be careful when adding custom code to these files, as only the code within
the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded
and re-saved.
so add your own code only inside those [xyz] sections and not outside them !
I add new button in DocumentWindow. Jucer add the button with addAndMakeVisible metod? and when my programm is running I receive:
âjuce_application.exe has triggered a breakpointâ and stop in
void ResizableWindow::addAndMakeVisible (Component* const child, int zOrder)
{
/* Agh! You shouldn't add components directly to a ResizableWindow - this class
manages its child components automatically, and if you add your own it'll cause
trouble. Instead, use setContentComponent() to give it a component which
will be automatically resized and kept in the right place - then you can add
subcomponents to the content comp. See the notes for the ResizableWindow class
for more info.
If you really know what you're doing and want to avoid this assertion, just call
Component::addAndMakeVisible directly.
*/
jassertfalse //my programm is stopped
Component::addAndMakeVisible (child, zOrder);
}
And I have to replaced addAndMakeVisible to Component::addAndMakeVisibleâŚ
When I use setContentComponent I have problem âUnhandled exception at 0x0051dd26 in juce_application.exe: 0xC0000005: Access violation reading location 0x0000001c.â in file â\src\juce_appframework\gui\graphics\geometry\juce_rectangle.hâ
/** Returns the width of the rectangle. */
inline int getWidth() const throw() { return w; }
I add new button in DocumentWindow. Jucer add the button with addAndMakeVisible metod? and when my programm is running I receive:
âjuce_application.exe has triggered a breakpointâ and stop in
void ResizableWindow::addAndMakeVisible (Component* const child, int zOrder)
{
/* Agh! You shouldn't add components directly to a ResizableWindow - this class
manages its child components automatically, and if you add your own it'll cause
trouble. Instead, use setContentComponent() to give it a component which
will be automatically resized and kept in the right place - then you can add
subcomponents to the content comp. See the notes for the ResizableWindow class
for more info.
If you really know what you're doing and want to avoid this assertion, just call
Component::addAndMakeVisible directly.
*/
jassertfalse //my programm is stopped
Component::addAndMakeVisible (child, zOrder);
}
And I have to replaced addAndMakeVisible to Component::addAndMakeVisibleâŚ
When I use setContentComponent I have problem âUnhandled exception at 0x0051dd26 in juce_application.exe: 0xC0000005: Access violation reading location 0x0000001c.â in file â\src\juce_appframework\gui\graphics\geometry\juce_rectangle.hâ
/** Returns the width of the rectangle. */
inline int getWidth() const throw() { return w; }
I add new button in DocumentWindow. Jucer add the button with addAndMakeVisible metod? and when my programm is running I receive:
âjuce_application.exe has triggered a breakpointâ and stop in
void ResizableWindow::addAndMakeVisible (Component* const child, int zOrder)
{
/* Agh! You shouldn't add components directly to a ResizableWindow - this class
manages its child components automatically, and if you add your own it'll cause
trouble. Instead, use setContentComponent() to give it a component which
will be automatically resized and kept in the right place - then you can add
subcomponents to the content comp. See the notes for the ResizableWindow class
for more info.
If you really know what you're doing and want to avoid this assertion, just call
Component::addAndMakeVisible directly.
*/
jassertfalse //my programm is stopped
Component::addAndMakeVisible (child, zOrder);
}
And I have to replaced addAndMakeVisible to Component::addAndMakeVisibleâŚ
When I use setContentComponent I have problem âUnhandled exception at 0x0051dd26 in juce_application.exe: 0xC0000005: Access violation reading location 0x0000001c.â in file â\src\juce_appframework\gui\graphics\geometry\juce_rectangle.hâ
/** Returns the width of the rectangle. */
inline int getWidth() const throw() { return w; }
I add new button in DocumentWindow. Jucer add the button with addAndMakeVisible metod? and when my programm is running I receive:
âjuce_application.exe has triggered a breakpointâ and stop in
void ResizableWindow::addAndMakeVisible (Component* const child, int zOrder)
{
/* Agh! You shouldn't add components directly to a ResizableWindow - this class
manages its child components automatically, and if you add your own it'll cause
trouble. Instead, use setContentComponent() to give it a component which
will be automatically resized and kept in the right place - then you can add
subcomponents to the content comp. See the notes for the ResizableWindow class
for more info.
If you really know what you're doing and want to avoid this assertion, just call
Component::addAndMakeVisible directly.
*/
jassertfalse //my programm is stopped
Component::addAndMakeVisible (child, zOrder);
}
And I have to replaced addAndMakeVisible to Component::addAndMakeVisibleâŚ
When I use setContentComponent I have problem âUnhandled exception at 0x0051dd26 in juce_application.exe: 0xC0000005: Access violation reading location 0x0000001c.â in file â\src\juce_appframework\gui\graphics\geometry\juce_rectangle.hâ
/** Returns the width of the rectangle. */
inline int getWidth() const throw() { return w; }
You shouldnât design a DocumentWindow in the jucer - use the jucer to build a normal component, and add that to a DocumentWindow as its content component.
I did explain this pretty clearly in that comment, didnât I?