X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/47908e25f992135fbc8c9573870784c62654e9e9..d1427b705318677afe28b1291867f6930c8823a7:/src/gtk1/button.cpp diff --git a/src/gtk1/button.cpp b/src/gtk1/button.cpp index 52c4e2d4b9..6588daad60 100644 --- a/src/gtk1/button.cpp +++ b/src/gtk1/button.cpp @@ -20,14 +20,23 @@ class wxButton; +//----------------------------------------------------------------------------- +// data +//----------------------------------------------------------------------------- + +extern bool g_blockEventsOnDrag; + //----------------------------------------------------------------------------- // wxButton //----------------------------------------------------------------------------- IMPLEMENT_DYNAMIC_CLASS(wxButton,wxControl) -void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) +static void gtk_button_clicked_callback( GtkWidget *WXUNUSED(widget), wxButton *button ) { + if (!button->HasVMT()) return; + if (g_blockEventsOnDrag) return; + wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, button->GetId()); event.SetEventObject(button); button->GetEventHandler()->ProcessEvent(event); @@ -56,8 +65,8 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, PreCreation( parent, id, pos, newSize, style, name ); - SetLabel(label); m_widget = gtk_button_new_with_label( m_label ); + SetLabel(label); if (newSize.x == -1) newSize.x = 15+gdk_string_measure( m_widget->style->font, label ); if (newSize.y == -1) newSize.y = 26; @@ -80,9 +89,8 @@ void wxButton::SetDefault(void) void wxButton::SetLabel( const wxString &label ) { wxControl::SetLabel( label ); + GtkButton *bin = GTK_BUTTON( m_widget ); + GtkLabel *g_label = GTK_LABEL( bin->child ); + gtk_label_set( g_label, GetLabel() ); }; -wxString wxButton::GetLabel(void) const -{ - return wxControl::GetLabel(); -};