Cannot press OK in Windows Print Dialog / How can i print in Windows ?

M

mzo

Hello
I want to use the Standard Windows Common Dialog, because i want a
orginal Windows Look and Feel in a pyGTK - GUI.

I use Python 2.3 with PythonWin GUI Extension and Win32 Extension.

ColorSelectionDialog, FileSelectionDialog, FontSelectionDialog work
well, but
PrintDialog do not work.

I have made a small example:
-----------------------------
import win32ui
import gtk

dllhandle = win32ui.LoadLibrary("C:\\WINNT\\SYSTEM32\\COMDLG32.DLL")

pcd = win32ui.CreatePrintDialog(1538, gtk.FALSE,
win32ui.PD_NOPAGENUMS|win32ui.PD_PAGENUMS|win32ui.PD_SELECTION|win32ui.PD_SHOWHELP|win32ui.PD_PRINTTOFILE|win32ui.PD_ALLPAGES,
None, dllhandle )

res = pcd.DoModal()
-----------------------------

This Example load the Print Dialog/ Print Setup but if i press OK
nothing do (The dialog do not close, like expected). I can the Window
only close with Cancel and get "2" back.
Whats´s wrong ?
How can i get the Settings and print with this settings after the
dialog ?


A not so important question is, how i can connect a Help-message to
the Help button in the Print Dialog ?



The Pythonwin-Printdialog (from pywin.mfc import dialog) use the
CreatePrintDialog but i do not know whats pinfo.
Where can i get pinfo (need to call this function).


The Head of PrintDialog is:
-----------------------------------------
class PrintDialog(Dialog):
" Base class for a print dialog"
def __init__(self, pInfo, dlgID,
printSetupOnly = 0,
flags=(win32ui.PD_ALLPAGES|
win32ui.PD_USEDEVMODECOPIES|
win32ui.PD_NOPAGENUMS|
win32ui.PD_HIDEPRINTTOFILE|
win32ui.PD_NOSELECTION),
parent=None,
dllid=None):
-------------------------------




Thanks
martin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,534
Members
45,008
Latest member
Rahul737

Latest Threads

Top