]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/button.cpp
missing commit
[wxWidgets.git] / src / gtk / button.cpp
index 73ccbca5809ebcba8ee812166e030086a6107371..a2ec92fdde239c3d860c2a4668e1ec5e771e5b2a 100644 (file)
@@ -36,7 +36,7 @@ wxgtk_button_clicked_callback(GtkWidget *WXUNUSED(widget), wxButton *button)
     if ( button->GTKShouldIgnoreEvent() )
         return;
 
-    wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId());
+    wxCommandEvent event(wxEVT_BUTTON, button->GetId());
     event.SetEventObject(button);
     button->HandleWindowEvent(event);
 }
@@ -171,17 +171,12 @@ wxSize wxButtonBase::GetDefaultSize()
         //     button's size. We have to retrieve both values and combine them.
 
         GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
-        GtkWidget *box = gtk_hbutton_box_new();
+        GtkWidget *box = gtk_button_box_new(GTK_ORIENTATION_HORIZONTAL);
         GtkWidget *btn = gtk_button_new_from_stock(GTK_STOCK_CANCEL);
         gtk_container_add(GTK_CONTAINER(box), btn);
         gtk_container_add(GTK_CONTAINER(wnd), box);
         GtkRequisition req;
-#ifdef __WXGTK3__
-        gtk_widget_get_preferred_height(btn, NULL, &req.height);
-        gtk_widget_get_preferred_width_for_height(btn, req.height, NULL, &req.width);
-#else
-        gtk_widget_size_request(btn, &req);
-#endif
+        gtk_widget_get_preferred_size(btn, NULL, &req);
 
         gint minwidth, minheight;
         gtk_widget_style_get(box,