+}
+
+// ----------------------------------------------------------------------------
+// redraw callback for multiline text
+// ----------------------------------------------------------------------------
+
+// redrawing a GtkText from inside a wxYield() call results in crashes (the
+// text sample shows it in its "Add lines" command which shows wxProgressDialog
+// which implicitly calls wxYield()) so we override GtkText::draw() and simply
+// don't do anything if we're inside wxYield()
+
+extern bool wxIsInsideYield;
+
+extern "C" {
+ typedef void (*GtkDrawCallback)(GtkWidget *widget, GdkRectangle *rect);
+}
+
+static GtkDrawCallback gs_gtk_text_draw = NULL;
+
+extern "C" {
+static void wxgtk_text_draw( GtkWidget *widget, GdkRectangle *rect)
+{
+ if ( !wxIsInsideYield )
+ {
+ wxCHECK_RET( gs_gtk_text_draw != wxgtk_text_draw,
+ _T("infinite recursion in wxgtk_text_draw aborted") );
+
+ gs_gtk_text_draw(widget, rect);
+ }
+}
+}