Re: How to produce a 'New Line' in GtkTextView ?



Thanks Mr. Boles & Mr. Ahlstedt,

Sorry and thanks for the patience... Indeed (and just for simplifying) what I put as 2nd parameter was a Glib::ustring object. Now, after some additional conversions (of kind of "search & replace") before inserting... the problem seems solved.

Glus


2017-03-13 10:23 GMT+01:00 Kjell Ahlstedt <kjell ahlstedt bredband net>:
Den 2017-03-12 kl. 13:28, skrev Glus Xof:
Hi guys,

Just in trouble trying to find why GtkTextView doesn't show a new line in this kind of code,

Glib::RefPtr<Gtk::TextBuffer> refTextBuffer = Gtk::TextBuffer::create();
refTextBuffer->insert_with_tag (refTextBuffer->end(), ".\n", refTag...);

Notice that the 2nd parameter of "insert_with_tag" is ".\n"... so why "\n" doesn't produce a new line here (instead of writing ".\n") ?

Glus

This is strange. Gtkmm's demo program, https://git.gnome.org/browse/gtkmm/tree/demos/gtk-demo/example_textview.cc, contains many lines like
iter = refBuffer->insert_with_tag(iter, "Blah blah\n", "char_wrap");
In the Gtk::TextView such lines end with a new line, not with "\n".



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]