static void
gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
- if (g_isIdle) wxapp_install_idle_handler();
-
if (!win->m_hasVMT) return;
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
win->SetModified();
wxCommandEvent event( wxEVT_COMMAND_TEXT_UPDATED, win->GetId() );
static void
gtk_scrollbar_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win )
{
- if (g_isIdle) wxapp_install_idle_handler();
+ if (!win->m_hasVMT) return;
+
+ if (g_isIdle)
+ wxapp_install_idle_handler();
win->CalculateScrollbar();
-
- if (!win->m_hasVMT) return;
}
//-----------------------------------------------------------------------------
if (m_vScrollbarVisible)
{
gtk_widget_hide( m_vScrollbar );
-
m_vScrollbarVisible = FALSE;
}
}
if (!m_vScrollbarVisible)
{
gtk_widget_show( m_vScrollbar );
-
m_vScrollbarVisible = TRUE;
}
}
{
wxCHECK_RET( m_text != NULL, _T("invalid text ctrl") );
+ gtk_signal_disconnect_by_func( GTK_OBJECT(m_text),
+ GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
+
wxString tmp = _T("");
if (!value.IsNull()) tmp = value;
if (m_windowStyle & wxTE_MULTILINE)
{
gtk_entry_set_text( GTK_ENTRY(m_text), tmp.mbc_str() );
}
+
+ gtk_signal_connect( GTK_OBJECT(m_text), "changed",
+ GTK_SIGNAL_FUNC(gtk_text_changed_callback), (gpointer)this);
}
void wxTextCtrl::WriteText( const wxString &text )