From 723a83c94a83c7dde13eb9bc8dbf651d212608ae Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 16 Oct 2012 14:02:17 +0000 Subject: [PATCH] Add a debug helper to show information about a GtkWidget under gdb. 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 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/gtk/window.cpp b/src/gtk/window.cpp index 7013dcf..d535250 100644 --- a/src/gtk/window.cpp +++ b/src/gtk/window.cpp @@ -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 //----------------------------------------------------------------------------- -- 2.7.4