Re: printing GtkTextView contents



On Mon, 21 Jul 2008 19:49:04 +0200
Emanuel Schwarz <schwarz emanuel gmail com> wrote:

> Hello,
> is there an easy way to get the contents of a GtkTextView so that i
> can draw it on a gtkPrintOperation surface?
> 
> Currently i think think the simplest way is to subclass GtkTextView
> and add a method for drawing its content on a arbitrary GdkDrawable
> (call GtkTextDisplays gtk_text_layout_draw func with the TextLayout
> slightly changed for printing).

Is your GtkTextView display actually in a layout and page format
suitable for printing, including correct pagination?

I would normally just get the text from the text buffer and then print
that.  (If you want to see my classes for printing plain text, which
will automatically format and paginate the text on a pango layout and
then print the text using GtkPrintOperation objects, I can point you to
them but they are written using C++, albeit using plain GTK+ without
language wrappers.)

Chris



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