#if wxUSE_COMBOBOX
#include "wx/settings.h"
-
-#include <wx/intl.h>
+#include "wx/intl.h"
#include "gdk/gdk.h"
#include "gtk/gtk.h"
wxComboBox::~wxComboBox()
{
- wxNode *node = m_clientDataList.First();
+ wxNode *node = m_clientObjectList.First();
while (node)
{
wxClientData *cd = (wxClientData*)node->Data();
if (cd) delete cd;
node = node->Next();
}
+ m_clientObjectList.Clear();
+
m_clientDataList.Clear();
}
{
wxCHECK_RET( m_widget != NULL, _T("invalid combobox") );
+ DisableEvents();
+
GtkWidget *list = GTK_COMBO(m_widget)->list;
gtk_list_select_item( GTK_LIST(list), n );
+
+ EnableEvents();
}
void wxComboBox::SetStringSelection( const wxString &string )
event.Skip();
}
+void wxComboBox::DisableEvents()
+{
+ GtkList *list = GTK_LIST( GTK_COMBO(m_widget)->list );
+ GList *child = list->children;
+ while (child)
+ {
+ gtk_signal_disconnect_by_func( GTK_OBJECT(child->data),
+ GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
+
+ child = child->next;
+ }
+}
+
+void wxComboBox::EnableEvents()
+{
+ GtkList *list = GTK_LIST( GTK_COMBO(m_widget)->list );
+ GList *child = list->children;
+ while (child)
+ {
+ gtk_signal_connect( GTK_OBJECT(child->data), "select",
+ GTK_SIGNAL_FUNC(gtk_combo_clicked_callback), (gpointer)this );
+
+ child = child->next;
+ }
+}
+
void wxComboBox::OnSize( wxSizeEvent &event )
{
event.Skip();