cpp/main.cpp
changeset 3 01dafa022fa1
parent 2 5331bd08a294
--- a/cpp/main.cpp	Sun Feb 13 07:57:02 2011 +0100
+++ b/cpp/main.cpp	Sun Feb 13 08:11:31 2011 +0100
@@ -3,7 +3,10 @@
 #include <wx/image.h>
 #include <wx/string.h>
 #include <wx/init.h>
+#include <fstream>
+#include <iostream>
 
+#include "main.hpp"
 #include "MainWindow.hpp"
 
 class MyApp : public wxApp
@@ -14,11 +17,33 @@
 
 IMPLEMENT_APP(MyApp)
 
+std::vector<std::string> words;
+
+void
+loadwords()
+{
+    std::ifstream f("words.txt");
+    
+    do
+    {
+        std::string s;
+        std::getline(f,s);
+        if (!f.fail())
+        {
+            words.push_back(s);
+            std::cerr << "Loaded: " << s << std::endl;
+        }
+    }while(!f.fail());
+
+}
+
 bool MyApp::OnInit()
 {
     if(!wxApp::OnInit())
         return false;
 
+    loadwords();
+
     MainWindow *mw = new MainWindow();
     mw->Show();
     SetTopWindow(mw);