Wrap label if necessary in wxInfoBar in wxGTK

Also update the sample to test showing an overlong message in wxInfoBar.

Closes https://github.com/wxWidgets/wxWidgets/pull/1443

See #14121.
This commit is contained in:
Igor Korot
2019-07-26 23:46:36 -05:00
committed by Vadim Zeitlin
parent 43c519e04f
commit 32d8b5954a
4 changed files with 15 additions and 2 deletions

View File

@@ -196,7 +196,11 @@ void wxInfoBar::ShowMessage(const wxString& msg, int flags)
if ( wxGTKImpl::ConvertMessageTypeFromWX(flags, &type) )
gtk_info_bar_set_message_type(GTK_INFO_BAR(m_widget), type);
gtk_label_set_text(GTK_LABEL(m_impl->m_label), wxGTK_CONV(msg));
gtk_label_set_line_wrap(GTK_LABEL(m_impl->m_label), TRUE );
#if GTK_CHECK_VERSION(2,10,0)
if( wx_is_at_least_gtk2( 10 ) )
gtk_label_set_line_wrap_mode(GTK_LABEL(m_impl->m_label), PANGO_WRAP_WORD);
#endif
if ( !IsShown() )
Show();