GNOME Bugzilla – Bug 342822
Non-UI printing example
Last modified: 2006-08-11 15:52:59 UTC
Here it is, based on gtk+/tests/testnouiprint.c . The only issue here is that a pango_cairo_* function (pango_cairo_layout_path) has to be used, as there is not (?) a pangomm equivalent.
Created attachment 66139 [details] [review] patch and .../examples/book/printing/non_ui
This is my first look at the new printing API. It looks pretty nice. As a newcomer, the dummy window thing is a bit confusing. Perhaps a comment about why you need to create a dummy window would be nice for this particular example (obviously any non-trivial example would already have a window to use for this argument, but for this non-ui example, I think it would help to explain it a little). [by the way, for things like this, it's nice if you choose the "compressed tar" filetype option instead of the "patch" option when you attach the file so that the browser doesn't try to display the binary tarball]
Created attachment 66150 [details] updated files Thanks Jonathon for your comments. I added a comment about the dummy window - I agree it can be confusing when you're just taking a look at this for the first time. As for the tar option - um well, I finally learned about this. I understood the patch checkbox in a general sense - I'd always just check that. (Murray: so _that_ is what you meant about my mimetypes being wrong :)...) First patch didn't have .../printing/Makefile.am - it's there now.
Well done. It looks like a nice test, but I'd prefer to eventually have a more real-world (but simple) example that 1. Let's the user change the print settings and choose the printer. 2. Let's the user choose to print, from a menu. 3. Actually shows the to-be-printed thing in a window. I'm gradually working on adding those pangocairo.h functions to cairo. Then I'll look at this again. Re. the dummy window: We should just add a run() overload that takes no window. See the C docs: ** * gtk_print_operation_run: * @op: a #GtkPrintOperation * @parent: Transient parent of the dialog, or %NULL * @error: Return location for errors, or %NULL
I confirm this is very useful, but is still not in the v2.9.10 tarfile.
We do we want a non-UI printing example?
Hm, I was gonna ask to close this. Ralf, have you looked at examples/book/printing/simple in the tarball? That's the one meant to be an introduction. This one here really does not do much.
So, closed.
Thanks Marko for the hint to examples which are disabled (without USE flag) in all Gentoo ebuilds so far. I'll open an issue on their tracker about this.