diff --git a/src/gui/panel/infobox-panel.cpp b/src/gui/panel/infobox-panel.cpp index cfc8e3a63..f4cd59ebd 100644 --- a/src/gui/panel/infobox-panel.cpp +++ b/src/gui/panel/infobox-panel.cpp @@ -63,9 +63,9 @@ namespace panel{ scroller_.set_shadow_type (Gtk::SHADOW_NONE); scroller_.set_border_width (10); - scroller_.add (textLog_); // the vertical scrollbar will always be necessary.... scroller_.set_policy (Gtk::POLICY_AUTOMATIC, Gtk::POLICY_ALWAYS); + scroller_.add (textLog_); textLog_.set_editable (false); @@ -95,9 +95,16 @@ namespace panel{ static uint bangNo{0}; static _Fmt msgTemplate{"Bang #%d\n"}; + + // According to the Gtkmm tutorial, TextView::scroll_to(iter) is not reliable; + // rather we need to use a text mark and set that text mark to the insert position. + // Actually, there is always one predefined text mark called "insert", which corresponds + // to the text cursor. Thus it suffices to navigate to text end, insert and scroll into view. auto buff = textLog_.get_buffer(); - auto pos = buff->insert (buff->end(), ustring{msgTemplate % ++bangNo}); - textLog_.scroll_to (pos); + auto cursor = buff->get_insert(); + buff->move_mark (cursor, buff->end()); + buff->insert (buff->end(), ustring{msgTemplate % ++bangNo}); + textLog_.scroll_to (cursor); } diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index 484c747be..2f78df523 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -1391,15 +1391,29 @@ - + + + + + + + + + + + + + + + @@ -18527,9 +18541,35 @@ - + + + + + + + + + + + + +
    +
  • + left gravity: Marker bleibt beim Einfügen an dieser Stelle links von der Einfügung stehen +
  • +
  • + right gravity: Marker wird durch Einfügen an dieser Stelle nach rechts geschoben +
  • +
+

+ Beachte: der Text-Cursor (Marker "insert") hat right gravity +

+ + +
+
@@ -18547,6 +18587,9 @@ + + +