void wxChoice::Init()
{
- m_strings = (wxSortedArrayString *)NULL;
+ m_strings = NULL;
m_stringCellIndex = 0;
}
}
m_widget = gtk_combo_box_new_text();
+ g_object_ref(m_widget);
Append(n, choices);
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid control") );
wxASSERT_MSG( !IsSorted() || (pos == GetCount()),
- _T("In a sorted choice data could only be appended"));
+ wxT("In a sorted choice data could only be appended"));
const int count = items.GetCount();
void wxChoice::DoDeleteOneItem(unsigned int n)
{
wxCHECK_RET( m_widget != NULL, wxT("invalid control") );
- wxCHECK_RET( IsValid(n), _T("invalid index in wxChoice::Delete") );
+ wxCHECK_RET( IsValid(n), wxT("invalid index in wxChoice::Delete") );
GtkComboBox* combobox = GTK_COMBO_BOX( m_widget );
GtkTreeModel* model = gtk_combo_box_get_model( combobox );
// in the combobox
if ( m_widget )
{
- ret.x = 60; // start with something "sensible"
+ ret.x = GetCount() > 0 ? 0 : 60; // start with something "sensible"
int width;
unsigned int count = GetCount();
for ( unsigned int n = 0; n < count; n++ )