- if (ret)
- {
- g_signal_stop_emission_by_name (widget, "key_press_event");
- return TRUE;
- }
-
- return FALSE;
-}
-}
-
-//-----------------------------------------------------------------------------
-// "select" and "deselect"
-//-----------------------------------------------------------------------------
-
-extern "C" {
-static gboolean gtk_listitem_select_cb( GtkTreeSelection* selection,
- GtkTreeModel* model,
- GtkTreePath* path,
- gboolean is_selected,
- wxListBox *listbox )
-{
- if (g_isIdle) wxapp_install_idle_handler();
-
- if (!listbox->m_hasVMT) return TRUE;
- if (g_blockEventsOnDrag) return TRUE;
-
- if (listbox->m_spacePressed) return FALSE; //see keyevent callback
- if (listbox->m_blockEvent) return TRUE;
-
- // NB: wxdocs explicitly say that this event only gets sent when
- // something is actually selected, plus the controls example
- // assumes so and passes -1 to the dogetclientdata funcs if not
-
- // OK, so basically we need to do a bit of a run-around here as
- // 1) is_selected says whether the item(s?) are CURRENTLY selected -
- // i.e. if is_selected is FALSE then the item is going to be
- // selected right now!
- // 2) However, since it is not already selected and the user
- // will expect it to be we need to manually select it and
- // return FALSE telling GTK we handled the selection
- if (is_selected) return TRUE;