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?
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…
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.