ClienteTFG/controlador.cpp

25 lines
583 B
C++
Raw Normal View History

2020-05-08 12:42:02 +02:00
#include "controlador.h"
#include <iostream>
controlador::controlador(vista *vis, conexion *con)
{
this->vis=vis;
this->con=con;
this->add_controlers();
}
void controlador::add_controlers(){
vis->m_button.signal_clicked().connect(sigc::mem_fun(this,
&controlador::on_button_clicked));
}
void controlador::on_button_clicked(){
std::string text = vis->m_refTextBuffer1->get_text();
std::cout << text << std::endl;
this->con->write_string("exec");
this->con->write_string(text);
this->con->read_string(text,10);
std::cout << text << std::endl;
}