X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/fab591c5cceff41c0bedaa89af34cd039e2c44e1..7cf4f7e21fc8b72498097e54c47c623331431f2c:/src/gtk/button.cpp diff --git a/src/gtk/button.cpp b/src/gtk/button.cpp index fc88afb789..fae04c1372 100644 --- a/src/gtk/button.cpp +++ b/src/gtk/button.cpp @@ -107,6 +107,21 @@ bool wxButton::Create( wxWindow *parent, wxWindowID id, const wxString &label, m_widget = gtk_button_new_with_label(""); + float x_alignment = 0.5; + if (HasFlag(wxBU_LEFT)) + x_alignment = 0.0; + else if (HasFlag(wxBU_RIGHT)) + x_alignment = 1.0; + + float y_alignment = 0.5; + if (HasFlag(wxBU_TOP)) + y_alignment = 0.0; + else if (HasFlag(wxBU_BOTTOM)) + y_alignment = 1.0; + + gtk_misc_set_alignment (GTK_MISC (BUTTON_CHILD (m_widget)), + x_alignment, y_alignment); + SetLabel( label ); if (style & wxNO_BORDER) @@ -173,6 +188,15 @@ bool wxButton::Enable( bool enable ) return TRUE; } +bool wxButton::IsOwnGtkWindow( GdkWindow *window ) +{ +#ifdef __WXGTK20__ + return GTK_BUTTON(m_widget)->event_window; +#else + return (window == m_widget->window); +#endif +} + void wxButton::ApplyWidgetStyle() { SetWidgetStyle();