]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/infobar.cpp
Add wxTranslations::GetTranslatedString().
[wxWidgets.git] / src / gtk / infobar.cpp
index e386a95f963a3aac9339b8c65e247653ff779adf..fb55f9b3a33d477294977db8e81d00c72072d9a5 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     wxInfoBar implementation for GTK
 // Author:      Vadim Zeitlin
 // Created:     2009-09-27
-// RCS-ID:      $Id$
 // Copyright:   (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
 // Licence:     wxWindows licence
 ///////////////////////////////////////////////////////////////////////////////
@@ -82,8 +81,12 @@ namespace
 
 inline bool UseNative()
 {
+#ifdef __WXGTK3__
+    return true;
+#else
     // native GtkInfoBar widget is only available in GTK+ 2.18 and later
     return gtk_check_version(2, 18, 0) == 0;
+#endif
 }
 
 } // anonymous namespace
@@ -193,7 +196,7 @@ void wxInfoBar::Dismiss()
 
 void wxInfoBar::GTKResponse(int btnid)
 {
-    wxCommandEvent event(wxEVT_COMMAND_BUTTON_CLICKED, btnid);
+    wxCommandEvent event(wxEVT_BUTTON, btnid);
     event.SetEventObject(this);
 
     if ( !HandleWindowEvent(event) )
@@ -209,9 +212,9 @@ GtkWidget *wxInfoBar::GTKAddButton(wxWindowID btnid, const wxString& label)
     GtkWidget *button = gtk_info_bar_add_button
                         (
                             GTK_INFO_BAR(m_widget),
-                            label.empty()
+                            (label.empty()
                                 ? GTKConvertMnemonics(wxGetStockGtkID(btnid))
-                                : label,
+                                : label).utf8_str(),
                             btnid
                         );
 
@@ -275,7 +278,7 @@ void wxInfoBar::DoApplyWidgetStyle(GtkRcStyle *style)
     wxInfoBarGeneric::DoApplyWidgetStyle(style);
 
     if ( UseNative() )
-        gtk_widget_modify_style(m_impl->m_label, style);
+        GTKApplyStyle(m_impl->m_label, style);
 }
 
 #endif // wxUSE_INFOBAR