Re: GtkPrintOperation; request for assistance
- From: Norbert de Jonge <mail norbertdejonge nl>
- To: gtk-app-devel-list gnome org
- Subject: Re: GtkPrintOperation; request for assistance
- Date: Fri, 10 Feb 2017 18:55:39 +0100
For a simple printing example in C this is my try at it.
https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Csamples/print_buffer1.c
Much appreciated Eric.
A question about this code. When I use, for example, the gedit text
editor, its File->Print... dialog includes a "Page Setup" tab where I
can use a "Paper size" drop-down to modify the paper size.
With your example, but also with the current GTK+ code for Ggradebook,
the "Paper size" drop-down is grayed out (disabled), /even/ after
selecting a valid printer.
The workaround I'm using with Ggradebook is to first run
gtk_print_run_page_setup_dialog(), then pass the resulting GtkPageSetup
values that the user supplied to the final dialog.
Is there a way to fix this.
In my opinion, your example application is close to being usable as a
generalized example. But it still needs to allow the user to specify a
paper format, and then extract margins - perhaps with a forced minimum -
and perform subsequent calculations based on those.
I'd like to end with a more general note about GTK+ and printing. This
is not about my work or your example, but something for the library
developers.
I'm a fan of GTK+ and have always been a fan. The printing
functionalities are extremely versatile. But it's difficult for me to
understand why there is no function that requires only a buffer (of any
size), font type and font size as parameters, then presents the user
with a print dialog. As a programmer, I don't want to think about
margins, pages, cairo, pango, and so on. I also feel sorry for all
other programmers who suddenly need to write begin_print() and
draw_page() functions just to print a buffer. I feel like there's room
for improvement here. :)
Best regards,
Norbert
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]