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


#1

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
{
public:
//==============================================================================
JuceGUIWindow()
: DocumentWindow (T(“Universal Test GUI”),
Colour(131,153,177),
DocumentWindow::allButtons,
true)
{
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);
	}
	else
	{
		AlertWindow::showMessageBox( AlertWindow::WarningIcon, T("Problems ^_^;"), T("Component initialization failure."), T("Goodbye.") );
		JUCEApplication::quit();
	}
}[/code]

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?


#2

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.


#3

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.


#4

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?


#5

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.


#6

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