After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 342822 - Non-UI printing example
Non-UI printing example
Status: RESOLVED NOTABUG
Product: gtkmm
Classification: Bindings
Component: general
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2006-05-24 16:43 UTC by Marko Anastasov
Modified: 2006-08-11 15:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
patch and .../examples/book/printing/non_ui (3.33 KB, patch)
2006-05-24 16:44 UTC, Marko Anastasov
none Details | Review
updated files (3.45 KB, application/x-compressed-tar)
2006-05-24 21:06 UTC, Marko Anastasov
  Details

Description Marko Anastasov 2006-05-24 16:43:31 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.
Comment 1 Marko Anastasov 2006-05-24 16:44:35 UTC
Created attachment 66139 [details] [review]
patch and .../examples/book/printing/non_ui
Comment 2 Jonathon Jongsma 2006-05-24 18:37:49 UTC
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]
Comment 3 Marko Anastasov 2006-05-24 21:06:42 UTC
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.
Comment 4 Murray Cumming 2006-05-28 19:21:17 UTC
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
Comment 5 Ralf Stephan 2006-08-11 09:48:26 UTC
I confirm this is very useful, but is still not in the v2.9.10 tarfile.
Comment 6 Murray Cumming 2006-08-11 10:04:51 UTC
We do we want a non-UI printing example?
Comment 7 Marko Anastasov 2006-08-11 11:35:11 UTC
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.
Comment 8 Murray Cumming 2006-08-11 12:44:18 UTC
So, closed.
Comment 9 Ralf Stephan 2006-08-11 15:52:59 UTC
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.