+#ifdef __WXGTK20__
+ GtkTextBuffer *text_buffer = gtk_text_view_get_buffer( GTK_TEXT_VIEW(m_text) );
+ gint l = gtk_text_buffer_get_char_count( text_buffer );
+
+ wxCHECK_MSG( start >= 0 && end <= l, FALSE,
+ _T("invalid range in wxTextCtrl::SetStyle") );
+
+ GtkTextIter starti, endi;
+ gtk_text_buffer_get_iter_at_offset( text_buffer, &starti, start );
+ gtk_text_buffer_get_iter_at_offset( text_buffer, &endi, end );
+
+ // use the attributes from style which are set in it and fall back
+ // first to the default style and then to the text control default
+ // colours for the others
+ wxTextAttr attr = wxTextAttr::Combine(style, m_defaultStyle, this);
+
+ PangoFontDescription *font_description = attr.HasFont()
+ ? attr.GetFont().GetNativeFontInfo()->description
+ : NULL;
+
+ GdkColor *colFg = attr.HasTextColour() ? attr.GetTextColour().GetColor()
+ : NULL;
+
+ GdkColor *colBg = attr.HasBackgroundColour()
+ ? attr.GetBackgroundColour().GetColor()
+ : NULL;
+
+ GtkTextTag *tag;
+ tag = gtk_text_buffer_create_tag( text_buffer, NULL, "font-desc", font_description,
+ "foreground-gdk", colFg,
+ "background-gdk", colBg, NULL );
+ gtk_text_buffer_apply_tag( text_buffer, tag, &starti, &endi );
+
+ return TRUE;
+#else
+ // VERY dirty way to do that - removes the required text and re-adds it
+ // with styling (FIXME)