Release build disables drag/drop and min/max/close buttons?


So, I’ve got an app that works great when I build it in Debug mode, but when I build in Release, the min/max/close buttons are disabled, and all my drag/drop between listboxes (which works great in Debug) stops working.

here’s my main.cpp

[code]class JuceGUIWindow : public DocumentWindow
: DocumentWindow (T(“Universal Test GUI”),
JuceGUIComponent* myJuceGUIComponent = new JuceGUIComponent();
if( myJuceGUIComponent->init() )
setContentComponent( myJuceGUIComponent );

		setVisible (true);
		setResizable( true, false );
		setResizeLimits( 640, 440, 960, 960 );
		//maximized = false;

		// centre the window on the desktop with this size
		centreWithSize (800, 500);
		AlertWindow::showMessageBox( AlertWindow::WarningIcon, T("Problems ^_^;"), T("Component initialization failure."), T("Goodbye.") );

I figured out that if I add: getMinimiseButton()->setEnabled( true ); getMaximiseButton()->setEnabled( true ); getCloseButton()->setEnabled( true );

Then the buttons will start working, but obviously drag/drop doesn’t work, and using “setEnabled” on my listboxes doesn’t fix them (they work fine other than the drag/drop functionality).

Why does Juce disable things in Release mode?


Well it doesn’t, of course.

It just sounds like your top-level window is disabled. No idea why that would happen unless you’ve disabled it yourself or corrupted the component’s flags somehow.


Well, I just added the “setEnabled” stuff to the DocumentWindow’s constructor and that fixed the buttons (but not the drag/drop stuff). If something was magically disabling the window, wouldn’t it have to be happening after the constructor was called? So it doesn’t make sense that calling getMaximiseButton()->setEnabled in the constructor would fix it.

Well, I used the Jucer for the main CPP file, and I doubt that corrupted anything, and I’m not directly doing anything to the component flags myself.


That is a bit odd, but there’s nothing in the library that would disable any of this stuff - it has to be something you’re doing in your code. Surely a few quick breakpoints in the D+D code will show you why that’s not doing anything?


I found the difference between Debug and Release…

Recompiling with Enable Run-Time Type Info = Yes (/GR) in the Language settings fixed everything. Odd that it would just break drag/drop and the title bar buttons.


Ah - that’d actually cause a lot more other problems in the long run!