stamen

Stamen - static menu generator
git clone git://git.dimitrijedobrota.com/stamen.git
Log | Files | Refs | README | LICENSE

main.cpp (906B)


      1 #include "demo_menu.hpp"
      2 #include "stamen.hpp"
      3 
      4 #include <iostream>
      5 
      6 int test_display(const char *title, const stamen::item_t itemv[], int size) {
      7     for (auto i = 0ul; i < size; i++) {
      8         std::cout << i + 1 << ": " << itemv[i].prompt << '\n';
      9     }
     10     std::cout << "Auto calling option 1...\n";
     11     itemv[1].callback(1);
     12     return 0;
     13 }
     14 
     15 int operation1(int) {
     16     std::cout << "operation 1" << std::endl;
     17     std::cout << "Some operation is done" << std::endl;
     18     return 1;
     19 }
     20 
     21 int operation2(int) {
     22     std::cout << "operation 2" << std::endl;
     23     std::cout << "Some other operation is done" << std::endl;
     24     return 1;
     25 }
     26 
     27 int operation3(int) {
     28     std::cout << "operation 3" << std::endl;
     29     std::cout << "Yet another operation is done" << std::endl;
     30     return 1;
     31 }
     32 
     33 int finish(int) {
     34     std::cout << "finishing..." << std::endl;
     35     exit(0);
     36 }
     37 
     38 int main() {
     39     menu_main(0);
     40     return 0;
     41 }