Skip to content

Commit

Permalink
Invoke load from command line
Browse files Browse the repository at this point in the history
  • Loading branch information
dlasalle committed Apr 6, 2018
1 parent 7d83a76 commit 8deed54
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/GUI/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <wx/display.h>
#include "App.hpp"
#include "MainWindow.hpp"
#include <stdexcept>



Expand All @@ -35,6 +36,17 @@ bool App::OnInit()
MainWindow * win = new MainWindow("MatrixInspector",rect.GetWidth()*0.1, \
rect.GetHeight()*0.1,rect.GetWidth()*0.8,rect.GetHeight()*0.8);
win->Show(true);

if (wxApp::argc == 1) {
// proceed normally
} else if (wxApp::argc == 2) {
// load a matrix/graph
win->load(std::string(wxApp::argv[1].mb_str()));
} else {
// bad commands
throw std::runtime_error("Bad arguments");
}

return true;
}

Expand Down

0 comments on commit 8deed54

Please sign in to comment.