]> git.llucax.com Git - z.facultad/75.42/plaqui.git/commitdiff
Agrego callback para salir del programa de 2 formas distinta : desde el menu creando...
authorRicardo Markiewicz <gazer.arg@gmail.com>
Thu, 16 Oct 2003 04:31:17 +0000 (04:31 +0000)
committerRicardo Markiewicz <gazer.arg@gmail.com>
Thu, 16 Oct 2003 04:31:17 +0000 (04:31 +0000)
Client/include/mnu_file_exit.h [new file with mode: 0644]
Client/src/Makefile.am
Client/src/client.glade
Client/src/main.cpp

diff --git a/Client/include/mnu_file_exit.h b/Client/include/mnu_file_exit.h
new file mode 100644 (file)
index 0000000..448950d
--- /dev/null
@@ -0,0 +1,18 @@
+
+/* Maneja el Archivo->Salir */
+
+#include <gtkmm.h>
+#include <iostream>
+
+class MnuFileExit:public Gtk::MenuItem {
+public:
+       MnuFileExit(BaseObjectType* cobject, const Glib::RefPtr<Gnome::Glade::Xml>& refGlade):Gtk::MenuItem(cobject) {
+       }
+       virtual ~MnuFileExit() {}
+
+protected:
+       virtual void on_activate() {
+               Gtk::Main::quit();
+       }
+};
+
index d4c08fe063d08b6b2f2e08750c3e65bcd0cc6794..25f41fd54917d1048422c34c271cc97e50292943 100644 (file)
@@ -1,6 +1,7 @@
 ## Process this file with automake to produce Makefile.in
 
 INCLUDES = \
 ## Process this file with automake to produce Makefile.in
 
 INCLUDES = \
+       -I../include \
        -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
        -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
        @PACKAGE_CFLAGS@
        -DPACKAGE_DATA_DIR=\""$(datadir)"\" \
        -DPACKAGE_LOCALE_DIR=\""$(prefix)/$(DATADIRNAME)/locale"\" \
        @PACKAGE_CFLAGS@
index 5575c48f1b93c82d39cb4bdc65675d99ecb8ae07..41e22a09c8c49d99389f61f8df9ba2bc78ff8dec 100644 (file)
                  </child>
 
                  <child>
                  </child>
 
                  <child>
-                   <widget class="GtkImageMenuItem" id="salir1">
+                   <widget class="GtkImageMenuItem" id="mnu_file_exit">
                      <property name="visible">True</property>
                      <property name="label">gtk-quit</property>
                      <property name="use_stock">True</property>
                      <property name="visible">True</property>
                      <property name="label">gtk-quit</property>
                      <property name="use_stock">True</property>
-                     <signal name="activate" handler="on_salir1_activate" last_modification_time="Thu, 16 Oct 2003 00:50:14 GMT"/>
-                   </widget>
-                 </child>
-               </widget>
-             </child>
-           </widget>
-         </child>
-
-         <child>
-           <widget class="GtkMenuItem" id="menuitem2">
-             <property name="visible">True</property>
-             <property name="label" translatable="yes">_Editar</property>
-             <property name="use_underline">True</property>
-
-             <child>
-               <widget class="GtkMenu" id="menuitem2_menu">
-
-                 <child>
-                   <widget class="GtkImageMenuItem" id="cortar1">
-                     <property name="visible">True</property>
-                     <property name="label">gtk-cut</property>
-                     <property name="use_stock">True</property>
-                     <signal name="activate" handler="on_cortar1_activate" last_modification_time="Thu, 16 Oct 2003 00:50:14 GMT"/>
-                   </widget>
-                 </child>
-
-                 <child>
-                   <widget class="GtkImageMenuItem" id="copiar1">
-                     <property name="visible">True</property>
-                     <property name="label">gtk-copy</property>
-                     <property name="use_stock">True</property>
-                     <signal name="activate" handler="on_copiar1_activate" last_modification_time="Thu, 16 Oct 2003 00:50:14 GMT"/>
-                   </widget>
-                 </child>
-
-                 <child>
-                   <widget class="GtkImageMenuItem" id="pegar1">
-                     <property name="visible">True</property>
-                     <property name="label">gtk-paste</property>
-                     <property name="use_stock">True</property>
-                     <signal name="activate" handler="on_pegar1_activate" last_modification_time="Thu, 16 Oct 2003 00:50:14 GMT"/>
-                   </widget>
-                 </child>
-
-                 <child>
-                   <widget class="GtkImageMenuItem" id="borrar1">
-                     <property name="visible">True</property>
-                     <property name="label">gtk-delete</property>
-                     <property name="use_stock">True</property>
-                     <signal name="activate" handler="on_borrar1_activate" last_modification_time="Thu, 16 Oct 2003 00:50:14 GMT"/>
+                     <signal name="activate" handler="on_mnu_exit_activate" last_modification_time="Thu, 16 Oct 2003 03:36:32 GMT"/>
                    </widget>
                  </child>
                </widget>
                    </widget>
                  </child>
                </widget>
                      <signal name="activate" handler="on_propiedades1_activate" last_modification_time="Thu, 16 Oct 2003 01:17:27 GMT"/>
 
                      <child internal-child="image">
                      <signal name="activate" handler="on_propiedades1_activate" last_modification_time="Thu, 16 Oct 2003 01:17:27 GMT"/>
 
                      <child internal-child="image">
-                       <widget class="GtkImage" id="image1">
+                       <widget class="GtkImage" id="image3">
                          <property name="visible">True</property>
                          <property name="stock">gtk-properties</property>
                          <property name="icon_size">1</property>
                          <property name="visible">True</property>
                          <property name="stock">gtk-properties</property>
                          <property name="icon_size">1</property>
              </child>
 
              <child>
              </child>
 
              <child>
-               <widget class="button" id="barr_exit">
+               <widget class="button" id="bar_exit">
                  <property name="visible">True</property>
                  <property name="label">gtk-quit</property>
                  <property name="use_stock">True</property>
                  <property name="visible">True</property>
                  <property name="label">gtk-quit</property>
                  <property name="use_stock">True</property>
index c1dfbf5a31590d809437a3f112e0f34c1df9bd8f..f7ca2a1750053f666dbbd07c082556a21f70d9cc 100644 (file)
@@ -2,6 +2,7 @@
 #include <gtkmm.h>
 #include <libglademm.h>
 #include <iostream>
 #include <gtkmm.h>
 #include <libglademm.h>
 #include <iostream>
+#include "mnu_file_exit.h"
 
 int main (int argc, char **argv)
 {
 
 int main (int argc, char **argv)
 {
@@ -18,10 +19,13 @@ int main (int argc, char **argv)
        }
 
        Gtk::Window* pWindow = 0;
        }
 
        Gtk::Window* pWindow = 0;
+       MnuFileExit *mnu_file_exit = 0;
+       Gtk::Button *bar_exit;
        refXml->get_widget("Principal", pWindow);
        refXml->get_widget("Principal", pWindow);
-  if (pWindow) {
-               client.run(*pWindow);
-       }
+       refXml->get_widget_derived("mnu_file_exit", mnu_file_exit);
+       refXml->get_widget("bar_exit", bar_exit);
+       bar_exit->signal_clicked().connect( SigC::slot(Gtk::Main::quit) );
+       client.run(*pWindow);
 
        return 0;
 }
 
        return 0;
 }