# createFileBrowserGoUpButton()?

**URL:** <https://forum.juce.com/t/createfilebrowsergoupbutton/10429>\
**Category:** General JUCE discussion\
**Created:** [May 9, 2013, 9:51pm UTC](https://forum.juce.com/t/createfilebrowsergoupbutton/10429 "2013-05-09T21:51:34Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [May 9, 2013, 9:51pm UTC](https://forum.juce.com/t/createfilebrowsergoupbutton/10429/1 "2013-05-09T21:51:34Z")

</div>

I’ve noticed that the look and feel of the fileBrowserGoUp button is created in the FIleBrowserDialogue constructor. Should its look and feel update if you call a setLookAndFeel() after creating the FileBrowserDialog? In my custom look and feel class I have overridden createFileBrowserGoUpButton() but it never gets called. It keeps calling the Juce one. Here’s what I do:

FileBrowserComponent browser (FileBrowserComponent::canSelectFiles|FileBrowserComponent::saveMode, File::nonexistent, &wildcardFilter, nullptr);  
FileChooserDialogBox dialogBox (“Open some kind of file”, “Please choose…”, browser, false, Colours::black);  
dialogBox.setLookAndFeel(basicLookAndFeel);  
browser.setLookAndFeel(basicLookAndFeel);

Any thoughts?

---

<div class="post-metadata">

**Author:** ![jrlanglois](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jrlanglois/32/21372_2.png) [@jrlanglois](https://forum.juce.com/u/jrlanglois)\
**Post date:** [May 10, 2013, 12:55am UTC](https://forum.juce.com/t/createfilebrowsergoupbutton/10429/2 "2013-05-10T00:55:43Z")

</div>

If possible, you could use the provided [juce::LookAndFeel::setDefaultLookAndFeel](http://www.rawmaterialsoftware.com/api/classLookAndFeel.html#a0d2cc7f39cb3804d68a6fd2a723d05a4) method.

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [May 10, 2013, 10:18am UTC](https://forum.juce.com/t/createfilebrowsergoupbutton/10429/3 "2013-05-10T10:18:06Z")

</div>

That doesn’t help either. It still draws the native up arrow. ☹

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [May 15, 2013, 6:33pm UTC](https://forum.juce.com/t/createfilebrowsergoupbutton/10429/4 "2013-05-15T18:33:54Z")

</div>

So I’ve hit this problem with another component now. I’m using a PropertyPanel. I have set my own look and feel, and have overridden the getDefaultScrollbarWidth() virtual function. But my propertypanel never calls it, which causes a sigrev when this function gets called:

int Viewport::getScrollBarThickness() const  
{  
return scrollBarThickness \> 0 ? scrollBarThickness  
: getLookAndFeel().getDefaultScrollbarWidth();  
}

I’ve put breakpoints in my look and feel at getDefaultScrollbarWidth() and it never gets hit? I’m missing something?

---

<div class="post-metadata">

**Author:** ![jnicol](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jnicol/32/1532_2.png) [@jnicol](https://forum.juce.com/u/jnicol)\
**Post date:** [April 15, 2018, 9:12am UTC](https://forum.juce.com/t/createfilebrowsergoupbutton/10429/5 "2018-04-15T09:12:57Z")

</div>

I have just run into the same thing. I cannot override the createFileBrowserGoUpButton method in LookAndFeel.

My suspicion is that this is happening because createFileBrowserGoUpButton is called in FileBrowserComponent’s constructor, before I have a chance to apply my custom LookAndFeel.

I am called setDefaultLookAndFeel() as in my AudioProcessorEditor’s constructor, but by then it is too late: FileBrowserComponent’s constructor has already run. Is there any way I can call setDefaultLookAndFeel earlier, or instantiate FileBrowserComponent later?

I also notice that I cannot change FileBrowserComponent’s “go up” arrow colour by overriding TextButton::textColourOffId, even when using sendLookAndFeelChange() after defining my custom colour.

I suspect this is because FileBrowserComponent’s lookAndFeelChanged() method does not update the colour of the goUpbutton.

@Rory, did you ever solve this one?

---

<div class="post-metadata">

**Author:** ![jnicol](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/jnicol/32/1532_2.png) [@jnicol](https://forum.juce.com/u/jnicol)\
**Post date:** [April 15, 2018, 9:39am UTC](https://forum.juce.com/t/createfilebrowsergoupbutton/10429/6 "2018-04-15T09:39:35Z")

</div>

I am happy to report that I was able to solve this one, thanks to a very instructive post by @lalala in this thread: [Best place for custom look instantiation in a plugin?](https://forum.juce.com/t/best-place-for-custom-look-instantiation-in-a-plugin/27231), which explains how to call setDefaultLookAndFeel before AudioProcessorEditor’s other members have instantiated.

I love these forums!

---

<div class="post-metadata">

**Author:** ![rory](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/rory/32/534_2.png) [@rory](https://forum.juce.com/u/rory)\
**Post date:** [April 15, 2018, 6:51pm UTC](https://forum.juce.com/t/createfilebrowsergoupbutton/10429/7 "2018-04-15T18:51:11Z")

</div>

Glad you got it sorted. Looks like I did too but it’s such a long time ago now I don’t recall how 😉 But yes, thank heaven for the forum. It’s saved many a developer!
