Re: Printing lines, shapes and pixmaps from a gnome canvas



Tambet Ingo wrote:

On Tue, 2003-01-21 at 13:01, Michael Meeks wrote:

/Hi Jean,

On Sat, 2003-01-18 at 14:38, Jean Br�rt wrote:
I am currently working on adding a print function to the Gnome Canvas,
so that when a canvas has been filled, a simple call to
gnome_canvas_print(canvas, pc) will print it (it must fit on one page).

	Sounds like this is a great idea. I tend to think though, that it's/


>From gnome-print FAQ (from Lauris, http://lists.ximian.com/archives/public/gnome-print/2001-May/000632.html):

It would be cool to have printing interface on canvas items!

It is not so cool at all. In model-view-controller context both
current gnome-canvas and gnome-print-context implement single
view. Adding subview (printing interface) to existing view (canvas) is
not very good idea.
What would be cool is either:
- Make generic graphic object class, that can render to different
 views (canvas and gnome-print)
- Make model-view based canvas, so objects are clearly distinct from
 display (and you can have multiple views of same object)

I am not sure I fully understand exactly what you mean. My english is not very fluent and I am not an expert programmer either. Canvas items can render themselves in anti-aliased and nonanti-aliased canvas with different functions. I do not see why they should not be able to print themselves. I could even print a canvas without rendering it on screen with the following actions:
- create a canvas
- fill it with some items
- call: while(gtk_events_pending()) gtk_main_iteration(); so that the canvas is updated
- print the result.
It works.

I agree that a model-view based canvas would be great but it would need much more work than I can do.

Best regards,
Jean







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