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:
@@ -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)
|
||||
{
|
||||
|
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user