gtkmm r980 - in branches/gtkmm-2-12: . gtk/src



Author: murrayc
Date: Sat Mar  8 21:17:44 2008
New Revision: 980
URL: http://svn.gnome.org/viewvc/gtkmm?rev=980&view=rev

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

* gtk/src/container.ccg: remove_callback(): When just calling the C 
callback, because the C++ object has already been destroyed, don't 
even call the C callback if the GType is exactly GtkContainer. This 
avoids a useless warning from GTK+ about an unimplemented remove() 
default signal handler. This happens when deriving from Gtk::Container - 
remove() really is implemented - it's just that we don't call our own 
implementation when that would be impossible.
Bug #518002 (Jonathon Jongsma).

Modified:
   branches/gtkmm-2-12/ChangeLog
   branches/gtkmm-2-12/gtk/src/container.ccg

Modified: branches/gtkmm-2-12/gtk/src/container.ccg
==============================================================================
--- branches/gtkmm-2-12/gtk/src/container.ccg	(original)
+++ branches/gtkmm-2-12/gtk/src/container.ccg	Sat Mar  8 21:17:44 2008
@@ -162,11 +162,20 @@
   }
   else
   {
+    //Call the original underlying C function:
+
+    //But don't do this if the GType is just the base GtkContainer 
+    //(the case when deriving from Gtk::Container)
+    //because GtkContainer::remove() then shows a warning that it was not implemented,
+    //and that warning is not useful to us in that case.
+    if(G_OBJECT_TYPE(self) == Gtk::Container::get_type())
+      return;
+
+    //Call the original underlying C function:
     BaseClassType *const base = static_cast<BaseClassType*>(
         g_type_class_peek_parent(G_OBJECT_GET_CLASS(self)) // Get the parent class of the object class (The original underlying C class).
     );
 
-    //Call the original underlying C function:
     if(base && base->remove)
       (*base->remove)(self, p0);
   }



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