X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/7a78a9378207266c55b7f4c72fbfb2ae11963d0b..88932ec82d048d006cdc81bd309f5e59aee799ac:/src/gtk/combobox.cpp?ds=sidebyside diff --git a/src/gtk/combobox.cpp b/src/gtk/combobox.cpp index ae69a86b37..40c437fa23 100644 --- a/src/gtk/combobox.cpp +++ b/src/gtk/combobox.cpp @@ -290,9 +290,9 @@ wxVisualAttributes wxComboBox::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) { #ifdef __WXGTK3__ - return GetDefaultAttributesFromGTKWidget(gtk_combo_box_new_with_entry, true); + return GetDefaultAttributesFromGTKWidget(gtk_combo_box_new_with_entry(), true); #else - return GetDefaultAttributesFromGTKWidget(gtk_combo_box_entry_new, true); + return GetDefaultAttributesFromGTKWidget(gtk_combo_box_entry_new(), true); #endif } @@ -409,10 +409,14 @@ wxSize wxComboBox::DoGetSizeFromTextSize(int xlen, int ylen) const { wxSize tsize( wxChoice::DoGetSizeFromTextSize(xlen, ylen) ); - // Add the margins we have previously set, but only the horizontal border - // as vertical one has been taken account in the prevoius call. - // Also get other GTK+ margins. - tsize.IncBy( GTKGetEntryMargins(GetEntry()).x, 0); + GtkEntry* entry = GetEntry(); + if (entry) + { + // Add the margins we have previously set, but only the horizontal border + // as vertical one has been taken account in the previous call. + // Also get other GTK+ margins. + tsize.IncBy(GTKGetEntryMargins(entry).x, 0); + } return tsize; }