projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
avoid calling GetDefaultSize() twice
[wxWidgets.git]
/
src
/
gtk
/
choice.cpp
diff --git
a/src/gtk/choice.cpp
b/src/gtk/choice.cpp
index ff73d1447488c4531a8e8224a1bb09a1ebf75916..d8819a2abc1880fab9563482cb3c07ddc7c7c05a 100644
(file)
--- a/
src/gtk/choice.cpp
+++ b/
src/gtk/choice.cpp
@@
-2,7
+2,6
@@
// Name: src/gtk/choice.cpp
// Purpose:
// Author: Robert Roebling
// Name: src/gtk/choice.cpp
// Purpose:
// Author: Robert Roebling
-// Id: $Id$
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// Copyright: (c) 1998 Robert Roebling
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
@@
-30,7
+29,7
@@
extern "C" {
static void
gtk_choice_changed_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice )
{
static void
gtk_choice_changed_callback( GtkWidget *WXUNUSED(widget), wxChoice *choice )
{
- choice->SendSelectionChangedEvent(wxEVT_C
OMMAND_CHOICE_SELECTED
);
+ choice->SendSelectionChangedEvent(wxEVT_C
HOICE
);
}
}
}
}
@@
-181,8
+180,12
@@
void wxChoice::DoDeleteOneItem(unsigned int n)
GtkTreeModel* model = gtk_combo_box_get_model( combobox );
GtkListStore* store = GTK_LIST_STORE(model);
GtkTreeIter iter;
GtkTreeModel* model = gtk_combo_box_get_model( combobox );
GtkListStore* store = GTK_LIST_STORE(model);
GtkTreeIter iter;
- gtk_tree_model_iter_nth_child( model, &iter,
- NULL, (gint) n );
+ if ( !gtk_tree_model_iter_nth_child(model, &iter, NULL, n) )
+ {
+ // This is really not supposed to happen for a valid index.
+ wxFAIL_MSG(wxS("Item unexpectedly not found."));
+ return;
+ }
gtk_list_store_remove( store, &iter );
m_clientData.RemoveAt( n );
gtk_list_store_remove( store, &iter );
m_clientData.RemoveAt( n );