X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32c77a71336262a7d7d5e79ac690a4bff78d1c92..54ff4a701f6c83aad8387a31b652f209681210cb:/src/gtk1/button.cpp?ds=inline diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 2201232c15..9e64e2579e 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -20,18 +20,26 @@ class wxButton; +//----------------------------------------------------------------------------- +// data +//----------------------------------------------------------------------------- + +extern bool g_blockEventsOnDrag; + //----------------------------------------------------------------------------- // wxButton //----------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxButton,wxControl) -void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), gpointer data ) +static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) { - wxButton *button = (wxButton*)data; + if (!button->HasVMT()) return; + if (g_blockEventsOnDrag) return; + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); - button->ProcessEvent(event); + button->GetEventHandler()->ProcessEvent(event); }; //-----------------------------------------------------------------------------