Back to index

texmacs  1.0.7.15
menus.cpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : menus.cpp
00004 * DESCRIPTION: A plugin which changes the menus dynamically
00005 *              The routine menus-add is defined in ../progs/init-menus.scm
00006 * COPYRIGHT  : (C) 2003  Joris van der Hoeven
00007 *******************************************************************************
00008 * This software falls under the GNU general public license version 3 or later.
00009 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00010 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00011 ******************************************************************************/
00012 
00013 #include <iostream>
00014 using namespace std;
00015 
00016 #define DATA_BEGIN   ((char) 2)
00017 #define DATA_END     ((char) 5)
00018 #define DATA_ESCAPE  ((char) 27)
00019 
00020 int
00021 main () {
00022   cout << DATA_BEGIN << "verbatim:";
00023   cout << "Enter the name of a menu to add at each prompt";
00024   cout << DATA_END;
00025   cout.flush ();
00026 
00027   while (true) {
00028     char buffer[100];
00029     cin.getline (buffer, 100, '\n');
00030     cout << DATA_BEGIN << "verbatim:";
00031     cout << DATA_BEGIN << "command:(menus-add \""
00032         << buffer << "\")" << DATA_END;
00033     cout << "Added " << buffer << " to menu";
00034     cout << DATA_END;
00035     cout.flush ();
00036   }
00037   return 0;
00038 }