BlinkenArea - GitList
Repositories
Blog
Wiki
libetherpix
Code
Commits
Branches
Tags
Search
Tree:
371800c
Branches
Tags
master
libetherpix
simulator
main.cpp
begin of simulator: window skeleton
Stefan Schuermans
commited
371800c
at 2017-06-07 21:38:03
main.cpp
Blame
History
Raw
/* * EtherPix simulator * * Copyright 2017 Stefan Schuermans <stefan schuermans info> * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, version 3 of the License. * * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <gtkmm.h> #include <iostream> #include <string.h> #include "etherpix_sim.glade.h" #include "main_window.h" int main(int argc, char *argv[]) { // instantiate GTK main loop Gtk::Main kit(argc, argv); // parse arguments if (argc < 2) { std::cerr << "usage: " << argv[0] << " <sim_config.etps>" << std::endl; return 2; } char *config_file_name = argv[1]; try { // create window Glib::RefPtr<Gtk::Builder> builder = Gtk::Builder::create_from_string(widgets_etherpix_sim); // connect main window to its class MainWindow *mainWindow; builder->get_widget_derived("MainWindow", mainWindow); // append config file name to window title mainWindow->set_title(mainWindow->get_title() + " - " + config_file_name); // run GTK main loop Gtk::Main::run(); } catch (std::exception &ex) { std::cerr << ex.what() << std::endl; return 3; } return 0; }