Algorithmic Solutions > LEDA > LEDA Guide > GraphWin > Customizing the Interactive Interface > Adding New Menus

Adding New GraphWin Menus

New menus can be added to existing menus of GraphWin or the main menu bar by calling the add_menu() operation. Each menu is represented by an integer (menu_id) from an internal numbering of all menus. The main menu has number zero.
    int gw.add_menu(GraphWin& gw, string label, int menu_id=0);
creates a sub-menu with label label in the menu with id menu_id. The id of the new menu is returned. The menu id of a standard menu can be obtained by calling get_menu(string) with the name of the menu, e.g.,
    gw.get_menu("Help");

Example

The following simple example shows how to add (sub-) menu to a GraphWin.

#include <LEDA/graphics/graphwin.h>

using namespace leda;

int main()
{
  GraphWin gw;

  int menu1 = gw.add_menu("components");
  gw.add_menu("simply connected", menu1);
  gw.add_menu("strongly connected", menu1);
  gw.add_menu("biconnected", menu1);

  gw.display(); gw.edit();

  return 0;
}

See also:

Customizing the Interactive Interface

GraphWin

Interactive Interface


Adding Simple Functions

Adding Member Functions

Adding Families of Functions

Complete Example for Customizing the Interface


Strings


Manual Pages:

Manual Page GraphWin




Please send any suggestions, comments or questions to leda@algorithmic-solutions.com
© Copyright 2001-2003, Algorithmic Solutions Software GmbH