Re: Print dialog issues on win32



On Mon, 2006-01-30 at 15:12 -0200, Daniel K. O. wrote:
> Alexander Larsson wrote:
> > I'm working on using the win32 print dialog (PrintDlgEx) behind the 
> > highlevel printing API I've been posting about. I've stumbled on an issue 
> > though. PrintDlgEx is a blocking call, so if you call it the mainloop 
> > won't execute until it returns. This means your other windows won't even 
> > repaint.
> >   
> 
> Why not just use SetTimer?
> 
> 
> ------
> void CALLBACK update_gui(HWND, UINT, UINT, DWORD)
> {
>         while (gtk_events_pending ())
>                 gtk_main_iteration();
> }
> 
> ...
> 
> UINT timer_id = SetTimer(NULL, 0, 10, update_gui);
> PrintDlgEx(...);
> KillTimer(NULL, timer_id);
> ------

This strikes me as less clean than using a thread for the dialog. For
instance, things get complicated if you have multiple print dialogs up.

Also, can't there be reentrancy issues if some code in the print dialog
calls out to the gtk mainloop. I can't think of a problem off the top of
my head, but it feels problematic.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's a superhumanly strong one-eyed sorceror on a mission from God. She's an 
enchanted African-American lawyer with a birthmark shaped like Liberty's 
torch. They fight crime! 




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