Re: Gtk Printing and gtk_dialog_run



On Fri, 2006-04-21 at 00:10 -0400, Matthias Clasen wrote:
> I made an attempt to implement async functions today, patch attached.
> They have only been very lightly tested. The patch adds two new functions:
> 
> void gtk_print_operation_run_async  (GtkPrintOperation  *op,
>                                                      GtkWindow        *parent);
> void gtk_print_run_page_setup_dialog_async  (GtkWindow        *parent,
>                                                                  
> GtkPageSetup    *page_setup,
>                                                                  
> GtkPrintSettings *settings,
>                                                                  
> GFunc                done_cb,
>                                                                  
> gpointer              data);
> 
> Both functions work on Unix by showing a modal dialog, connecting a
> handler for the response signal, and then returning. Note that the async version
> of gtk_print_operation_run() looses both the result that is returned, and the
> error parameter. I think the return value can be substituted by storing the
> print settings in the begin-print (or end-print) handler.
> 
> On windows, both functions work in the same way as their non-async variants.

This looks good to me. The one thing i'm slightly worried about is apps
keeping the GtkPrintOperation objetc around to long. After all the
rendering is done its totally safe to drop the object, but you can keep
it around longer to get status updates of the print job if you want.
This might not be obvious, and apps may keep the object around even
though they don't display any print job status, which will lead to
unnecessary polling and app memory use.

Maybe we could make this more obvious by having another signal
"finished_rendering" or something? This could also restore the lost
error.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a Nobel prize-winning one-eyed jungle king in drag. She's a beautiful 
renegade bounty hunter who hides her beauty behind a pair of thick-framed 
spectacles. They fight crime! 




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