]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/combobox.cpp
Use checkbox if togglebutton not available.
[wxWidgets.git] / src / gtk / combobox.cpp
index ee0cc2e8d5a590cf991002118210fa931b96e72c..ab4fa422edac764b002964f86c78a773dd09f06a 100644 (file)
@@ -614,7 +614,7 @@ void wxComboBox::SetEditable( bool editable )
 
 void wxComboBox::OnChar( wxKeyEvent &event )
 {
 
 void wxComboBox::OnChar( wxKeyEvent &event )
 {
-    if ( event.KeyCode() == WXK_RETURN )
+    if ( event.GetKeyCode() == WXK_RETURN )
     {
         wxString value = GetValue();
 
     {
         wxString value = GetValue();
 
@@ -750,13 +750,11 @@ wxSize wxComboBox::DoGetBestSize() const
     ret.x = 0;
     if ( m_widget )
     {
     ret.x = 0;
     if ( m_widget )
     {
-        GdkFont *font = m_font.GetInternalFont();
-
-        wxCoord width;
-        size_t count = Number();
+        int width;
+        size_t count = GetCount();
         for ( size_t n = 0; n < count; n++ )
         {
         for ( size_t n = 0; n < count; n++ )
         {
-            width = (wxCoord)gdk_string_width(font, wxGTK_CONV( GetString(n) ) );
+            GetTextExtent( GetString(n), &width, NULL, NULL, NULL, &m_font );
             if ( width > ret.x )
                 ret.x = width;
         }
             if ( width > ret.x )
                 ret.x = width;
         }