2 /* Maneja el Ayuda->Acerca de */
5 #include <glibmm/iochannel.h>
8 class MnuHelpAbout:public Gtk::MenuItem {
10 MnuHelpAbout(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):Gtk::MenuItem(cobject) {
12 virtual ~MnuHelpAbout() {}
15 Glib::RefPtr<Gnome::Glade::Xml> refXml;
17 virtual void on_activate() {
18 // preparo para leer el archivo ChangeLog
20 Glib::RefPtr<Gtk::TextBuffer> log_buffer;
21 Glib::RefPtr<Glib::IOChannel> log_io;
23 log_buffer = Gtk::TextBuffer::create();
24 log_io = Glib::IOChannel::create_from_file("../ChangeLog", "r");
25 while (log_io->read_line(line) != Glib::IO_STATUS_EOF) {
26 log_buffer->insert_at_cursor(line);
30 refXml = Gnome::Glade::Xml::create("client.glade", "dlgAbout");
32 catch(const Gnome::Glade::XmlError &ex) {
33 std::cerr << ex.what() << std::endl;
37 Gtk::Button *btn_cerrar = 0;
38 Gtk::TextView *txt_changelog = 0;
39 refXml->get_widget("dlgAbout", dlg);
40 refXml->get_widget("btn_close", btn_cerrar);
41 refXml->get_widget("txt_changelog", txt_changelog);
42 btn_cerrar->signal_clicked().connect(SigC::slot(*dlg, &Gtk::Dialog::hide));
43 txt_changelog->set_buffer(log_buffer);