]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/gnome/GAbout.C
applying Martin Craig's gnome patch. Upgrading to gtkmm-2.0+ from the 1.3 developmen...
[lyx.git] / src / frontends / gnome / GAbout.C
index 1df4a355fcefc6f16d4973b2c807950ab5e0d6d1..530b0ddab3b103cc97050860d8f7f0f9ed814bab 100644 (file)
 #include "support/lstrings.h"
 #include "Lsstream.h"
 
-
+#include "gnome_helpers.h"
 #include "gnomeBC.h"
 #include "GAbout.h"
 
 #include <gtkmm/button.h>
 #include <gtkmm/textview.h>
 
-GAbout::GAbout(ControlAboutlyx & c)
-       : GnomeCB<ControlAboutlyx>(c, "GAbout")
+GAbout::GAbout()
+       : GnomeCB<ControlAboutlyx>("GAbout")
 {}
 
 
@@ -69,21 +69,26 @@ void GAbout::update()
        istringstream ss(in.str());
 
        string s;
-       string out;
-       Gtk::TextIter  e;
+       Glib::RefPtr<Gtk::TextBuffer> buf = credits()->get_buffer();
 
+       addDefaultTags(buf);
        while (getline(ss, s)) {
 
-               if (prefixIs(s, "@b"))
-                       out += s.substr(2);
+               if (prefixIs(s, "@b")) 
+                       buf->insert_with_tag(buf->end(), 
+                                            Glib::locale_to_utf8(s.substr(2)), 
+                                            "bold");
                else if (prefixIs(s, "@i"))
-                       out += s.substr(2);
+                       buf->insert_with_tag(buf->end(), 
+                                            Glib::locale_to_utf8(s.substr(2)), 
+                                            "italic");
                else
-                       out += s.substr(2);
+                       buf->insert(buf->end(), 
+                                   Glib::locale_to_utf8(s.substr(2)));
+               buf->insert(buf->end(),"\n");
 
-               out += "\n";
        }
-       credits()->get_buffer()->set_text(out);
+
 }