Algorithmic Solutions > LEDA > LEDA Guide > GraphWin > Customizing the Interactive Interface > Changing the Main Menu

Changing the GraphWin Main Menu

The default menus in GraphWin's menu bar are determined by a bit mask that is the bitwise-or of an arbitrary subset of the predefined constants M_FILE, M_EDIT, M_GRAPH, M_LAYOUT, M_WINDOW, M_OPTIONS, M_HELP, M_DONE.

Each constant represents one standard menu. The constant M_COMPLETE is defined as the bitwise-or of all constants above, i.e., it specifies a menu bar containing all standard menus.

    long gw.set_default_menu(long mask);

defines the set of standard menus. mask is the bitwise-or of an arbitrary subset of the predefined constants above.

    void gw.del_menu(long mask);

removes all menus corresponding to 1-bits in mask.

Remark: gw.set_default_menu() and gw.del_menu() must be called before gw.display().

Example

The following simple example shows how to set the default menu of a GraphWin.

#include <LEDA/graphics/graphwin.h>

using namespace leda;

int main()
{
  GraphWin gw;

  //add selected items to the default menu bar (before gw.display()!)
  gw.set_default_menu(M_FILE|M_EDIT|M_GRAPH|M_WINDOW|M_HELP|M_DONE);

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

  return 0;
}

See also:

Customizing the Interactive Interface

GraphWin

Interactive Interface


Manual Pages:

Manual Page GraphWin




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