From 9b82d31bdd6c4f21d9475b52444e57fc1ab94cde Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 8 Oct 2006 13:44:32 +0000 Subject: [PATCH] Unicode compilation fix git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@41702 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/aboutdlg.cpp | 39 +++++++++++++++++++++++++++++++-------- 1 file changed, 31 insertions(+), 8 deletions(-) diff --git a/src/gtk/aboutdlg.cpp b/src/gtk/aboutdlg.cpp index e801284c92..16fb5d14fa 100644 --- a/src/gtk/aboutdlg.cpp +++ b/src/gtk/aboutdlg.cpp @@ -29,6 +29,19 @@ #include "wx/gtk/private.h" +// ---------------------------------------------------------------------------- +// GtkStr: temporary GTK string +// ---------------------------------------------------------------------------- + +class GtkStr : public wxGtkString +{ +public: + GtkStr(const wxString& s) + : wxGtkString(wx_const_cast(char *, wxGTK_CONV_SYS(s).data())) + { + } +}; + // ---------------------------------------------------------------------------- // GtkArray: temporary array of GTK strings // ---------------------------------------------------------------------------- @@ -73,15 +86,15 @@ void wxAboutBox(const wxAboutDialogInfo& info) if ( !gtk_check_version(2,6,0) ) { GtkAboutDialog * const dlg = GTK_ABOUT_DIALOG(gtk_about_dialog_new()); - gtk_about_dialog_set_name(dlg, info.GetName()); + gtk_about_dialog_set_name(dlg, GtkStr(info.GetName())); if ( info.HasVersion() ) - gtk_about_dialog_set_version(dlg, info.GetVersion()); + gtk_about_dialog_set_version(dlg, GtkStr(info.GetVersion())); if ( info.HasCopyright() ) - gtk_about_dialog_set_copyright(dlg, info.GetCopyright()); + gtk_about_dialog_set_copyright(dlg, GtkStr(info.GetCopyright())); if ( info.HasDescription() ) - gtk_about_dialog_set_comments(dlg, info.GetDescription()); + gtk_about_dialog_set_comments(dlg, GtkStr(info.GetDescription())); if ( info.HasLicence() ) - gtk_about_dialog_set_license(dlg, info.GetLicence()); + gtk_about_dialog_set_license(dlg, GtkStr(info.GetLicence())); wxIcon icon = info.GetIcon(); if ( icon.Ok() ) @@ -89,8 +102,12 @@ void wxAboutBox(const wxAboutDialogInfo& info) if ( info.HasWebSite() ) { - gtk_about_dialog_set_website(dlg, info.GetWebSiteURL()); - gtk_about_dialog_set_website_label(dlg, info.GetWebSiteDescription()); + gtk_about_dialog_set_website(dlg, GtkStr(info.GetWebSiteURL())); + gtk_about_dialog_set_website_label + ( + dlg, + GtkStr(info.GetWebSiteDescription()) + ); } if ( info.HasDevelopers() ) @@ -100,7 +117,13 @@ void wxAboutBox(const wxAboutDialogInfo& info) if ( info.HasArtists() ) gtk_about_dialog_set_artists(dlg, GtkArray(info.GetArtists())); if ( info.HasTranslators() ) - gtk_about_dialog_set_translator_credits(dlg, _("translator-credits")); + { + gtk_about_dialog_set_translator_credits + ( + dlg, + GtkStr(_("translator-credits")) + ); + } gtk_widget_show(GTK_WIDGET(dlg)); return; -- 2.45.2