Re: Split TextView

2017-03-11 Thread David C. Rankin
On 02/23/2017 01:55 PM, Tuur Dutoit wrote:
> Ideally, every page would be a TextView, all backed by 1 TextBuffer, but
> that doesn't seem to be possible (out of the box)...
> 
> How would you do this?

  Why wouldn't that be possible? Each text view allows you to test focus on
the text view directly do something similar to the following for each
text_view window:

gtk_text_view_get_visible_rect (GtkTextView *text_view,
GdkRectangle *visible_rect);

and from that get an iter:

gtk_text_view_get_iter_location (GtkTextView *text_view,
 const GtkTextIter *iter,
 GdkRectangle *location);

  Which you can check against the current "insert" mark and iter obtained from:

GtkTextMark *
gtk_text_buffer_get_insert (GtkTextBuffer *buffer);

void
gtk_text_buffer_get_iter_at_mark (GtkTextBuffer *buffer,
  GtkTextIter *iter,
  GtkTextMark *mark);

  The text view with the "insert" mark would scroll on its own as you advance
the cursor (just as using a single text view would). I don't see any problem
switching between the views to control the split-view you are trying to create.

-- 
David C. Rankin, J.D.,P.E.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Split TextView

2017-02-23 Thread Tuur Dutoit
Hello,

I'm trying to make a simple word processor with GTK+, but I got stuck on a 
seemingly simple issue: I would like to break down the content in multiple 
pages, like Microsoft word and LibreOffice do, but I can't figure out how to do 
that. I have a few ideas, but they all sound very complicated and would require 
a lot of work.
Ideally, every page would be a TextView, all backed by 1 TextBuffer, but that 
doesn't seem to be possible (out of the box)...

How would you do this?

Tuur Dutoit
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list