]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Constructor/ventana.cpp
Se corrigen typos.
[z.facultad/75.42/plaqui.git] / Constructor / ventana.cpp
1 //ventana.cpp
2 #include "ventana.h"
3 Ventana::Ventana(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):
4 Gtk::Window(cobject) 
5 {
6         refGlade->get_widget("button9", btn_salir);
7         refGlade->get_widget("fixed1", fixed);
8         refGlade->get_widget("button6",btn_dibujar);
9         btn_salir->signal_released().connect(SigC::slot(*this,&Ventana::on_btn_salir_pressed ));
10         btn_dibujar->signal_released().connect(SigC::slot(*this,&Ventana::on_btn_dibujar_released ));
11         //btn_dibujar->set_title("una N");
12 }
13
14 Ventana::~Ventana()
15 {
16 }
17
18 void Ventana::on_btn_salir_pressed()
19 {
20         Gtk::Main::quit();
21 }
22
23 void Ventana::on_btn_dibujar_released()
24 {
25         //quiero dibujar en el fixed 
26         // como lo obtengo??
27         Glib::RefPtr<Gdk::Window> win = get_window();
28         Glib::RefPtr<Gdk::GC> gc = get_style()->get_black_gc();
29         win->draw_line(gc,50,50, 50,100);
30         win->draw_line(gc,50,50, 80, 100);
31         win->draw_line (gc,80,100, 80,50);
32         
33         win->draw_line (gc,90,50, 90,100);
34         
35         win->draw_line (gc,100,50, 100,100);
36         win->draw_line (gc,100,50, 150,50);
37         win->draw_line (gc,100,100,150,100);
38         
39         win->draw_line (gc,160,50, 160,100);
40         win->draw_line (gc,160,50, 210,50);
41         win->draw_line (gc,160,100, 210,100);
42         win->draw_line (gc,210,50, 210,100);
43 }