]> git.llucax.com Git - z.facultad/75.42/plaqui.git/blob - Client/src/main.cpp
f7ca2a1750053f666dbbd07c082556a21f70d9cc
[z.facultad/75.42/plaqui.git] / Client / src / main.cpp
1
2 #include <gtkmm.h>
3 #include <libglademm.h>
4 #include <iostream>
5 #include "mnu_file_exit.h"
6
7 int main (int argc, char **argv)
8 {
9         Gtk::Main client(argc, argv);
10
11         //Load the Glade file and instiate its widgets:
12         Glib::RefPtr<Gnome::Glade::Xml> refXml;
13         try {
14                 refXml = Gnome::Glade::Xml::create("client.glade", "Principal");
15         }
16         catch(const Gnome::Glade::XmlError& ex) {
17                 std::cerr << ex.what() << std::endl;
18                 return 1;
19         }
20
21         Gtk::Window* pWindow = 0;
22         MnuFileExit *mnu_file_exit = 0;
23         Gtk::Button *bar_exit;
24         refXml->get_widget("Principal", pWindow);
25         refXml->get_widget_derived("mnu_file_exit", mnu_file_exit);
26         refXml->get_widget("bar_exit", bar_exit);
27         bar_exit->signal_clicked().connect( SigC::slot(Gtk::Main::quit) );
28         client.run(*pWindow);
29
30         return 0;
31 }
32