On 07/23/16 14:57, Greg Ercolano wrote:
> Try: "http:\\/\\/
www.cnn.com", e.g.
>
> Fl_Menu_Bar *menu = new Fl_Menu_Bar(0,0,400,25);
> menu->add("File/Open");
> menu->add("File/New");
> menu->add("File/http:\\/\\/
www.cnn.com"); // <-- this
> menu->add("File/Quit", FL_CTRL+'q', Quit_CB);
BTW, another way to do it is to create a dummy item first,
then change the item's label() afterwards, e.g.
int i = menu->add("File/xxx");
((Fl_Menu_Item*)&menu->menu()[i])->label("
http://www.cnn.com");
So used in context:
Fl_Menu_Bar *menu = new Fl_Menu_Bar(0,0,400,25);
menu->add("File/Open");
menu->add("File/New");
int i = menu->add("File/xxx"); // add 'xxx' to the File menu..
((Fl_Menu_Item*)&menu->menu()[i])->label("
http://www.cnn.com"); // then change the 'xxx' item to the url
menu->add("File/Quit");
The reason this works is '/'s indicate submenus only in the Fl_Menu_::add() methods.
They have no such meaning in the menu item's label() method.