Hi Sanel,

That's neat - I didn’t know that worked!


> First you need to assign callback to desired Fl_Menu_Item, whose colors
> you are going to change. From callback you can access Fl_Menu_Bar and
> by
> using mvalue() member, you can access to selected item; from there you
> can change label color, background and etc.
> 
> Here is example:
> 
> static void color_cb(Fl_Widget *w, void*) {
>   Fl_Menu_Bar *bar = (Fl_Menu_Bar*)w;
>   if(!bar->mvalue()) return;
> 
>   Fl_Menu_Item *self = (Fl_Menu_Item*)bar->mvalue();
>   self->labelcolor(FL_RED);
> }
> 
> // your Fl_Menu_Item table:
> 
> static Fl_Menu_Item table[] = {
>   {"&File", 0,0,0,FL_SUBMENU},
>   {"To red", 0, color_cb},
>   {0}
> };



********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
fltk@easysw.com
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to