gtkmm-documentation r65 - in trunk: . examples/book/dialogs/aboutdialog



Author: murrayc
Date: Wed Sep  3 15:35:35 2008
New Revision: 65
URL: http://svn.gnome.org/viewvc/gtkmm-documentation?rev=65&view=rev

Log:
2008-09-03  Murray Cumming  <murrayc murrayc com>

* examples/book/dialogs/aboutdialog/examplewindow.cc:
* examples/book/dialogs/aboutdialog/examplewindow.h: Respond to the Close 
button. Bug #550675 (GÃtz Waschk).

Modified:
   trunk/ChangeLog
   trunk/examples/book/dialogs/aboutdialog/examplewindow.cc
   trunk/examples/book/dialogs/aboutdialog/examplewindow.h

Modified: trunk/examples/book/dialogs/aboutdialog/examplewindow.cc
==============================================================================
--- trunk/examples/book/dialogs/aboutdialog/examplewindow.cc	(original)
+++ trunk/examples/book/dialogs/aboutdialog/examplewindow.cc	Wed Sep  3 15:35:35 2008
@@ -50,11 +50,25 @@
   list_authors.push_back("AN Other");
   m_Dialog.set_authors(list_authors);
 
+  m_Dialog.signal_response().connect( sigc::mem_fun(*this, &ExampleWindow::on_about_dialog_response) );
+
   show_all_children();
 }
 
 ExampleWindow::~ExampleWindow()
 {
+ 
+}
+
+void ExampleWindow::on_about_dialog_response(int response_id)
+{
+  std::cout << response_id << ", close=" << GTK_RESPONSE_CLOSE << ", cancel=" << GTK_RESPONSE_CANCEL << std::endl;
+
+  if((response_id == Gtk::RESPONSE_CLOSE) &&
+     (response_id == Gtk::RESPONSE_CANCEL) )
+  {
+    m_Dialog.hide();
+  }
 }
 
 void ExampleWindow::on_button_clicked()

Modified: trunk/examples/book/dialogs/aboutdialog/examplewindow.h
==============================================================================
--- trunk/examples/book/dialogs/aboutdialog/examplewindow.h	(original)
+++ trunk/examples/book/dialogs/aboutdialog/examplewindow.h	Wed Sep  3 15:35:35 2008
@@ -29,7 +29,8 @@
 
 protected:
   //Signal handlers:
-  virtual void on_button_clicked();
+  void on_button_clicked();
+  void on_about_dialog_response(int response_id);
 
   //Child widgets:
   Gtk::VButtonBox m_ButtonBox;



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]