]> git.saurik.com Git - wxWidgets.git/commitdiff
Add a debug helper to show information about a GtkWidget under gdb.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 16 Oct 2012 14:02:17 +0000 (14:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 16 Oct 2012 14:02:17 +0000 (14:02 +0000)
For now just give its type which is not exactly exhaustive but better than
nothing.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72688 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/window.cpp

index 7013dcf7995008533903f4e5bf46345dade7657f..d5352509f4ff1e7bb1cd936487e38389e12da68d 100644 (file)
@@ -226,6 +226,17 @@ int          g_lastButtonNumber = 0;
 // the trace mask used for the focus debugging messages
 #define TRACE_FOCUS wxT("focus")
 
+// A handy function to run from under gdb to show information about the given
+// GtkWidget. Right now it only shows its type, we could enhance it to show
+// more information later but this is already pretty useful.
+const char* wxDumpGtkWidget(GtkWidget* w)
+{
+    static wxString s;
+    s.Printf("GtkWidget %p, type \"%s\"", w, G_OBJECT_TYPE_NAME(w));
+
+    return s.c_str();
+}
+
 //-----------------------------------------------------------------------------
 // "expose_event"/"draw" from m_wxwindow
 //-----------------------------------------------------------------------------