X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/14f355c2b5c71fc7c3d680aea366582d2ac60f7b..5cb598ae2014330aaecbd19b8bbe41df2ad61911:/src/gtk1/statbmp.cpp?ds=sidebyside diff --git a/src/gtk1/statbmp.cpp b/src/gtk1/statbmp.cpp index e069dbfbf2..6ec5169750 100644 --- a/src/gtk1/statbmp.cpp +++ b/src/gtk1/statbmp.cpp @@ -54,7 +54,7 @@ void wxStaticBitmap::CreatePixmapWidget() m_focusWidget = m_widget; - PostCreation(); + PostCreation(wxDefaultSize); } bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bitmap, @@ -78,22 +78,16 @@ bool wxStaticBitmap::Create( wxWindow *parent, wxWindowID id, const wxBitmap &bi if ( m_bitmap.GetMask() ) mask = m_bitmap.GetMask()->GetBitmap(); m_widget = gtk_pixmap_new( m_bitmap.GetPixmap(), mask ); - - SetBestSize( size ); } else { m_widget = gtk_label_new( "Bitmap" ); - m_focusWidget = m_widget; - - PostCreation(); } + PostCreation(size); m_parent->DoAddChild( this ); - Show( TRUE ); - return TRUE; } @@ -119,9 +113,18 @@ void wxStaticBitmap::SetBitmap( const wxBitmap &bitmap ) gtk_pixmap_set( GTK_PIXMAP(m_widget), m_bitmap.GetPixmap(), mask ); } - SetBestSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight())); + InvalidateBestSize(); + SetSize(GetBestSize()); } } +// static +wxVisualAttributes +wxStaticBitmap::GetClassDefaultAttributes(wxWindowVariant WXUNUSED(variant)) +{ + // TODO: overload to allow using gtk_pixmap_new? + return GetDefaultAttributesFromGTKWidget(gtk_label_new); +} + #endif // wxUSE_STATBMP