X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1481968400c94128642815b6871724f118141cbc..8168167976dc3cc5f5223a21e1a62ba91a4f77b3:/src/gtk/listbox.cpp diff --git a/src/gtk/listbox.cpp b/src/gtk/listbox.cpp index fae6eb8e79..ad3193f273 100644 --- a/src/gtk/listbox.cpp +++ b/src/gtk/listbox.cpp @@ -240,13 +240,7 @@ gtk_listbox_key_press_callback( GtkWidget *widget, listbox->m_spacePressed = true; } - if (ret) - { - g_signal_stop_emission_by_name (widget, "key_press_event"); - return TRUE; - } - - return FALSE; + return ret; } } @@ -398,12 +392,11 @@ static gboolean gtk_listbox_searchequal_callback(GtkTreeModel* model, WXLISTBOX_DATACOLUMN_ARG(listbox), &entry, -1); wxCHECK_MSG(entry, 0, wxT("Could not get entry")); - gchar* keycollatekey = g_utf8_collate_key(key, -1); + wxGtkString keycollatekey(g_utf8_collate_key(key, -1)); int ret = strcasecmp(keycollatekey, gtk_tree_entry_get_collate_key(entry)); - g_free(keycollatekey); g_object_unref (entry); return ret != 0; @@ -562,6 +555,7 @@ bool wxListBox::Create( wxWindow *parent, wxWindowID id, gtk_container_add (GTK_CONTAINER (m_widget), GTK_WIDGET(m_treeview) ); gtk_widget_show( GTK_WIDGET(m_treeview) ); + m_focusWidget = GTK_WIDGET(m_treeview); wxListBox::DoInsertItems(wxArrayString(n, choices), 0); // insert initial items @@ -948,6 +942,7 @@ void wxListBox::DoSetSelection( int n, bool select ) { // ... and not generate any events in the process GtkDeselectAll(); + return; } wxCHECK_RET( IsValid(n), wxT("invalid index in wxListBox::SetSelection") ); @@ -1028,7 +1023,7 @@ int wxListBox::DoListHitTest(const wxPoint& point) const { // gtk_tree_view_get_path_at_pos() also gets items that are not visible and // we only want visible items we need to check for it manually here - if ( !GetClientRect().Inside(point) ) + if ( !GetClientRect().Contains(point) ) return wxNOT_FOUND; // need to translate from master window since it is in client coords