X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07e9d4f0ed60853477155f0a460b93ecc91e7f85..400a9e419b229cd511d73922bd5506aaab3b120e:/src/gtk1/textctrl.cpp diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 93416da331..648fdab6a5 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -310,6 +310,8 @@ bool wxTextCtrl::Create( wxWindow *parent, if (!HasFlag(wxNO_BORDER)) gtk_scrolled_window_set_shadow_type( GTK_SCROLLED_WINDOW(m_widget), GTK_SHADOW_IN ); + + GTK_WIDGET_UNSET_FLAGS( m_widget, GTK_CAN_FOCUS ); #else // create our control ... m_text = gtk_text_new( (GtkAdjustment *) NULL, (GtkAdjustment *) NULL ); @@ -347,8 +349,7 @@ bool wxTextCtrl::Create( wxWindow *parent, m_focusWidget = m_text; PostCreation(); - - SetFont( parent->GetFont() ); + InheritAttributes(); wxSize size_best( DoGetBestSize() ); wxSize new_size( size ); @@ -444,8 +445,8 @@ bool wxTextCtrl::Create( wxWindow *parent, else #endif { - gtk_signal_connect( GTK_OBJECT(m_text), "changed", - GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); + gtk_signal_connect( GTK_OBJECT(m_text), "changed", + GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this); } // we don't set a valid background colour, because the window @@ -608,7 +609,7 @@ void wxTextCtrl::WriteText( const wxString &text ) // in UpdateFontIfNeeded() any longer if ( !text.empty() ) { - m_updateFont = TRUE; + m_updateFont = FALSE; } // Bring editable's cursor back uptodate. @@ -674,10 +675,21 @@ wxString wxTextCtrl::GetLineText( long lineNo ) const return buf; } else -#endif { return wxEmptyString; } +#else + GtkTextBuffer *text_buffer; + text_buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(m_text)); + GtkTextIter line; + gtk_text_buffer_get_iter_at_line(text_buffer,&line,lineNo); + GtkTextIter end; + gtk_text_buffer_get_end_iter(text_buffer,&end ); + gchar *text = gtk_text_buffer_get_text(text_buffer,&line,&end,TRUE); + wxString result(wxGTK_CONV_BACK(text)); + g_free(text); + return result.BeforeFirst(wxT('\n')); +#endif } else {