Algorithmic Solutions > LEDA > LEDA Guide > GraphWin > Customizing the Interactive Interface > Adding GraphWin Member Functions

Adding GraphWin Member Functions

Not every operation of the programming interface of GraphWin is available in the interactive interface. However, there is an easy way of adding operations of type void GraphWin::func();. The operation
    gw.add_member(void (*GraphWin::func)(), 
                  string label, int menu_id=0);

adds a new button with label label to the menu with id menu_id.

Example:

The following program adds a "redraw" button, that calls gw.redraw(), to the main menu bar, we use
#include <LEDA/graphics/graphwin.h>

int main()
{
  leda::GraphWin gw;

  gw.add_member_call(&leda::GraphWin::redraw,"redraw");

  gw.display(); gw.edit();
 
  return 0;
}

See also:

Customizing the Interactive Interface

GraphWin

Interactive Interface

Programming Interface


Adding New Menus

Adding Simple Functions

Adding Families of Functions

Complete Example for Customizing the Interface


Windows and Panels

Panel Buttons


Graph Data Types


Manual Pages:

Manual Page GraphWin




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