- size_t index;
- if ( m_strings )
- {
- // sorted control, need to insert at the correct index
- index = m_strings->Add(item);
-
- gtk_menu_insert( GTK_MENU(menu), menu_item, index );
-
- if ( index )
- {
- m_clientList.Insert( m_clientList.Item(index - 1),
- (wxObject*) NULL );
- }
- else
- {
- m_clientList.Insert( (wxObject*) NULL );
- }
- }
- else
- {
- // don't call wxChoice::GetCount() from here because it doesn't work
- // if we're called from ctor (and GtkMenuShell is still NULL)
-
- // normal control, just append
- if (pos == (int)m_clientList.GetCount())
- {
- gtk_menu_append( GTK_MENU(menu), menu_item );
- m_clientList.Append( (wxObject*) NULL );
- index = m_clientList.GetCount() - 1;
- }
- else
- {
- gtk_menu_insert( GTK_MENU(menu), menu_item, pos );
- m_clientList.Insert( pos, (wxObject*) NULL );
- index = pos;
- }
- }
+ // Set a as small as possible size for the control, so preferred sizes
+ // return "natural" sizes, not taking into account the previous ones (which
+ // seems to be GTK+3 behaviour)
+ gtk_widget_set_size_request(m_widget, 0, 0);