crash in GTK 1.0 on multiline text ctrl creation fixed

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2378 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
1999-05-09 18:00:35 +00:00
parent 404d805e79
commit 3358d36e06
2 changed files with 130 additions and 116 deletions

View File

@@ -222,12 +222,19 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
if (!value.IsEmpty())
{
gint tmp = 0;
#if GTK_MINOR_VERSION == 0
// if we don't realize it, GTK 1.0.6 dies with a SIGSEGV in
// gtk_editable_insert_text()
gtk_widget_realize(m_text);
#endif // GTK 1.0
#if wxUSE_UNICODE
wxWX2MBbuf val = value.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), val, strlen(val), &tmp );
#else
#else // !Unicode
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
#endif
#endif // Unicode/!Unicode
if (multi_line)
{

View File

@@ -222,12 +222,19 @@ bool wxTextCtrl::Create( wxWindow *parent, wxWindowID id, const wxString &value,
if (!value.IsEmpty())
{
gint tmp = 0;
#if GTK_MINOR_VERSION == 0
// if we don't realize it, GTK 1.0.6 dies with a SIGSEGV in
// gtk_editable_insert_text()
gtk_widget_realize(m_text);
#endif // GTK 1.0
#if wxUSE_UNICODE
wxWX2MBbuf val = value.mbc_str();
gtk_editable_insert_text( GTK_EDITABLE(m_text), val, strlen(val), &tmp );
#else
#else // !Unicode
gtk_editable_insert_text( GTK_EDITABLE(m_text), value, value.Length(), &tmp );
#endif
#endif // Unicode/!Unicode
if (multi_line)
{