gui/graph-displayer.cc
author hegyi
Sun, 07 Aug 2005 14:17:11 +0000
changeset 1614 350c1d8bb7cc
parent 1512 e54392395480
child 1616 78704393218d
permissions -rw-r--r--
Alpar had the key, focus can be set in the window class. But it is not enough, the focused widget has to be activated, as well! Was a hard task to find out... By the way, two compilation warnings are removed.
     1 #include "all_include.h"
     2 #include "mapstorage.h"
     3 #include "main_win.h"
     4 #include <libgnomecanvasmm.h>
     5 #include <libgnomecanvasmm/polygon.h>
     6 
     7 #define MAIN_PART
     8 
     9 std::vector <std::string> edge_property_strings;
    10 std::vector <double> edge_property_defaults;
    11 std::vector <std::string> node_property_strings;
    12 std::vector <double> node_property_defaults;
    13 
    14 
    15 int main(int argc, char *argv[])
    16 {
    17 
    18   //initializing
    19 
    20   edge_property_strings.resize(EDGE_PROPERTY_NUM);
    21   edge_property_strings[E_WIDTH]="Edge Width";
    22   edge_property_strings[E_COLOR]="Edge Color";
    23   edge_property_strings[E_TEXT]="Edge Text";
    24 
    25   edge_property_defaults.resize(EDGE_PROPERTY_NUM);
    26   edge_property_defaults[E_WIDTH]=10.0;
    27   edge_property_defaults[E_COLOR]=100;
    28   edge_property_defaults[E_TEXT]=0;
    29 
    30   node_property_strings.resize(NODE_PROPERTY_NUM);
    31   node_property_strings[N_RADIUS]="Node Radius";
    32   node_property_strings[N_COLOR]="Node Color";
    33   node_property_strings[N_TEXT]="Node Text";
    34 
    35   node_property_defaults.resize(NODE_PROPERTY_NUM);
    36   node_property_defaults[N_RADIUS]=20.0;
    37   node_property_defaults[N_COLOR]=100;
    38   node_property_defaults[N_TEXT]=0;
    39 
    40   //initializing GUI
    41 
    42   Gnome::Canvas::init();
    43   Gtk::Main app(argc, argv);
    44 
    45   MainWin mainwin("Displayed Graph");
    46   app.run(mainwin);
    47 
    48   return 0;
    49 }