File: script_window.cpp

package info (click to toggle)
antimony 0.9.3-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 6,476 kB
  • sloc: cpp: 42,596; ansic: 28,661; python: 1,093; yacc: 128; lex: 114; sh: 90; makefile: 10
file content (28 lines) | stat: -rw-r--r-- 764 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <Python.h>

#include "window/script_window.h"
#include "script/frame.h"
#include "script/editor.h"

#include "graph/watchers.h"

ScriptWindow::ScriptWindow(Script* script)
    : BaseWindow("Script"), frame(new ScriptFrame(script, this))
{
    setCentralWidget(frame);

    ui->menuView->deleteLater();
    ui->menuAdd->deleteLater();

    resize(600, 800);
}

////////////////////////////////////////////////////////////////////////////////

void ScriptWindow::onStateChanged(const ScriptState& state)
{
    frame->getEditor()->setText(QString::fromStdString(state.script));
    frame->getEditor()->highlightError(state.error_lineno);
    frame->setOutput(QString::fromStdString(state.output));
    frame->setError(QString::fromStdString(state.error));
}