+// Notice that this method shouldn't be necessary, because GTK calculates
+// properly size of the combobox but for unknown reasons it doesn't work
+// correctly in wx without this.
+wxSize wxChoice::DoGetBestSize() const
+{
+ // strangely, this returns a width of 188 pixels from GTK+ (?)
+ wxSize ret( wxControl::DoGetBestSize() );
+
+ // we know better our horizontal extent: it depends on the longest string
+ // in the combobox
+ if ( m_widget )
+ {
+ ret.x = GetCount() > 0 ? 0 : 60; // start with something "sensible"
+ int width;
+ unsigned int count = GetCount();
+ for ( unsigned int n = 0; n < count; n++ )