main.cpp
author viric <viriketo@gmail.com>
Sun, 24 Apr 2011 20:43:56 +0200
changeset 4 6d09f682bc3e
parent 2 b2772bffb62f
permissions -rw-r--r--
Afegeixo scripts que faig servir per a fer llibres. Aquests són de Duna.

#include <wx/wx.h>
#include <wx/log.h>
#include <wx/image.h>
#include <wx/string.h>
#include <wx/init.h>

#include <vector>

#include "MainWindow.hpp"

class MyApp : public wxApp
{
    public:
        virtual bool OnInit();
};

IMPLEMENT_APP(MyApp)

bool MyApp::OnInit()
{
    if (argc < 2)
        return false;

    ::wxInitAllImageHandlers();

    std::vector<wxString> imgs;
    for(int i=1; i < argc; ++i)
    {
        wxString filename(argv[i]);
        imgs.push_back(filename);
    }

    MainWindow *mw = new MainWindow(imgs, wxDefaultSize);
    mw->Show();

    return true;
}