- wxControl::SetLabel( label );
- GtkBin *bin = GTK_BIN( m_widget );
- GtkLabel *g_label = GTK_LABEL( bin->child );
- gtk_label_set( g_label, GetLabel() );
-};
+ wxCHECK_RET( m_widget != NULL, wxT("invalid button") );
+
+ wxControl::SetLabel( label );
+
+ gtk_label_set( GTK_LABEL( BUTTON_CHILD(m_widget) ), GetLabel().mbc_str() );
+}
+
+bool wxButton::Enable( bool enable )
+{
+ if ( !wxControl::Enable( enable ) )
+ return FALSE;
+
+ gtk_widget_set_sensitive( BUTTON_CHILD(m_widget), enable );
+
+ return TRUE;
+}
+
+void wxButton::ApplyWidgetStyle()
+{
+ SetWidgetStyle();
+ gtk_widget_set_style( m_widget, m_widgetStyle );
+ gtk_widget_set_style( BUTTON_CHILD(m_widget), m_widgetStyle );
+}
+
+wxSize wxButton::DoGetBestSize() const
+{
+ wxSize ret( wxControl::DoGetBestSize() );
+
+ if (!HasFlag(wxBU_EXACTFIT))
+ {
+ if (ret.x < 80) ret.x = 80;
+ }
+
+ return ret;
+}
+
+#endif // wxUSE_BUTTON