// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
+#if wxUSE_TEXTCTRL
+
#include "wx/textctrl.h"
#ifndef WX_PRECOMP
return;
}
+ if ( !(flags & SetValue_SendEvent) )
+ {
+ g_signal_handlers_block_by_func(GetTextObject(),
+ (gpointer)gtk_text_changed_callback, this);
+ }
+
if ( IsMultiLine() )
{
- g_signal_handlers_disconnect_by_func (m_buffer,
- (gpointer) gtk_text_changed_callback, this);
-
gtk_text_buffer_set_text( m_buffer, buffer, strlen(buffer) );
if ( !m_defaultStyle.IsDefault() )
wxGtkTextApplyTagsFromAttr(m_widget, m_buffer, m_defaultStyle,
&start, &end);
}
-
- g_signal_connect (m_buffer, "changed",
- G_CALLBACK (gtk_text_changed_callback), this);
}
- else
+ else // single line
{
- g_signal_handlers_disconnect_by_func (m_text,
- (gpointer) gtk_text_changed_callback, this);
-
gtk_entry_set_text( GTK_ENTRY(m_text), buffer );
-
- g_signal_connect (m_text, "changed",
- G_CALLBACK (gtk_text_changed_callback), this);
+ }
+
+ if ( !(flags & SetValue_SendEvent) )
+ {
+ g_signal_handlers_unblock_by_func(GetTextObject(),
+ (gpointer)gtk_text_changed_callback, this);
}
// This was added after discussion on the list
{
return GetDefaultAttributesFromGTKWidget(gtk_entry_new, true);
}
+
+#endif // wxUSE_TEXTCTRL