# PopupMenu fonts using LookAndFeel

**URL:** <https://forum.juce.com/t/popupmenu-fonts-using-lookandfeel/3400>\
**Category:** General JUCE discussion\
**Created:** [November 27, 2008, 6:14pm UTC](https://forum.juce.com/t/popupmenu-fonts-using-lookandfeel/3400 "2008-11-27T18:14:13Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nicolas\_Knall](https://avatars.discourse-cdn.com/v4/letter/n/898d66/32.png) [@Nicolas\_Knall](https://forum.juce.com/u/Nicolas_Knall)\
**Post date:** [November 27, 2008, 6:14pm UTC](https://forum.juce.com/t/popupmenu-fonts-using-lookandfeel/3400/1 "2008-11-27T18:14:13Z")

</div>

On my way to implement a LookAndFeel for popup menu, I succeded in drawing a red background for popup menu, but I could not find a way to change the font, when apparently the method is the strictly the same !

in .h :

[code]class My\_Look\_And\_Feel : public Component,  
public LookAndFeel  
{  
public:  
//==============================================================================  
My\_Look\_And\_Feel ();  
~My\_Look\_And\_Feel();

```
//==============================================================================
//[UserMethods] -- You can add your own custom methods in this section.
void drawPopupMenuBackground (Graphics &g, int width, int height);
const Font getMenuBarFont (MenuBarComponent &menuBar,int itemIndex, const String & itemText);
//[/UserMethods]

void paint (Graphics& g);
void resized();

```

juce\_UseDebuggingNewOperator

private:

```
My_Look_And_Feel (const My_Look_And_Feel&);
const My_Look_And_Feel& operator= (const My_Look_And_Feel&);

```

};[/code]

And in the cpp file :

[code]void My\_Look\_And\_Feel::drawPopupMenuBackground (Graphics &g, int width, int height)  
{  
g.fillAll (Colours::red);  
} \<\<\<\<\< this one gets called

const Font My\_Look\_And\_Feel::getMenuBarFont(MenuBarComponent &menuBar, int itemIndex, const String & itemText)  
{  
Font myFont;  
myFont.setSizeAndStyle((float)(6),0,1.0f,0.0f);  
myFont.setItalic(true);  
myFont.setBold(true);  
return myFont;  
} \<\<\<\<\< this one never gets called[/code]

It must be some syntax problem, I really don’t have any clue, the getMenuBarFont seems to never be called, what am I doing wrong ?

Nicolas

---

<div class="post-metadata">

**Author:** ![jaydee](https://avatars.discourse-cdn.com/v4/letter/j/ee7513/32.png) [@jaydee](https://forum.juce.com/u/jaydee)\
**Post date:** [November 27, 2008, 6:36pm UTC](https://forum.juce.com/t/popupmenu-fonts-using-lookandfeel/3400/2 "2008-11-27T18:36:37Z")

</div>

const Font My\_Look\_And\_Feel::getPopupMenuFont()

---

<div class="post-metadata">

**Author:** ![Nicolas\_Knall](https://avatars.discourse-cdn.com/v4/letter/n/898d66/32.png) [@Nicolas\_Knall](https://forum.juce.com/u/Nicolas_Knall)\
**Post date:** [November 27, 2008, 6:40pm UTC](https://forum.juce.com/t/popupmenu-fonts-using-lookandfeel/3400/3 "2008-11-27T18:40:27Z")

</div>

DOH…doh…dohh…

I should sleep more , thanks !

Nicolas

---

<div class="post-metadata">

**Author:** ![marvu](https://avatars.discourse-cdn.com/v4/letter/m/cc9497/32.png) [@marvu](https://forum.juce.com/u/marvu)\
**Post date:** [December 6, 2017, 3:28pm UTC](https://forum.juce.com/t/popupmenu-fonts-using-lookandfeel/3400/4 "2017-12-06T15:28:54Z")

</div>

Hey! Is there a way to change the font size of an PopupMenu item responsively? The LnF method does not know about the PopupMenu object, neither the editor window size… It just looks strange that everything is smoothly responsive in my GUI except of the dropdowns… Thanks in advance!

---

<div class="post-metadata">

**Author:** ![railjonrogut](https://sea2.discourse-cdn.com/flex026/user_avatar/forum.juce.com/railjonrogut/32/505_2.png) [@railjonrogut](https://forum.juce.com/u/railjonrogut)\
**Post date:** [December 6, 2017, 10:15pm UTC](https://forum.juce.com/t/popupmenu-fonts-using-lookandfeel/3400/5 "2017-12-06T22:15:39Z")

</div>

Add a public method in your LnF to set the font size… and if your GUI changes size… set the font size and trigger a repaint.

Rail
