Changing the Look and Feel of the Dialog Close Button

I’ve been trying for a few days but i can’t for the life of me get this thing to work. I’m trying to replace the close button button but overrideing the
createDialogBoxCloseButton() method in my own look and feel object. then set the main dialog windows lookandFeel to my new object.
i was wondering is it even possable to replace the ShapeButton used by the default with an Image Button?

here is an example of my method,

Button* closeStyle::createDialogBoxCloseButton()

	ImageButton* const cb = new ImageButton (T("close"));

	return cb;


Yeah, I came up against this in my Pedal Board. What you have to do is call the static LookAndFeel::setDefaultLookAndFeel() method in JUCEApplication::initialise() (not sure if it has to be in initialise()?). Here’s my code:

DialogBoxCloseButton *laf = new DialogBoxCloseButton(); LookAndFeel::setDefaultLookAndFeel(laf);
Where DialogBoxCloseButton is a subclass of the LookAndFeel class (laf = LookAndFeel). I’m not sure if it’s a bug in JUCE that this is the only way to change the DialogWindow’s close button, but it does seem a little strange…

  • Niall.

ah, sorry - that’s a bug in DialogWindow. What it should do is respond to the look and feel change by recreating its close button, but it doesn’t. It’s only a bugette, I’ll sort it out for the next version. Setting the default look and feel is a good workaround in the meantime.

Cool thanks that did the trick

my button does seam to be a bit croped though is there any way to ajust the size and placement of the close button?

never mind i figured it out all you have to do is override the DialogWindow::resize method.