[wxPython] printing from wxTextCtrl

Why dosen't the following print to my printer?
It does print 'Print Routine Here' on the screen.

    def OnFilePrint(self, evt): # Print
        self.printData = wxPrintData()
        self.printData.SetPaperId(wxPAPER_LETTER)

        printdata = self.control.GetValue()
        pdd = wxPrintDialogData()
        pdd.SetPrintData(self.printData)
        printer = wxPrinter(pdd)
        dlg = wxPrintDialog(self, pdd)
        try:
            if dlg.ShowModal() == wxID_OK:
                # Your code
                print 'Print Routine Here'
                self.printData =
printer.GetPrintDialogData().GetPrintData()
                
        finally:
            dlg.Destroy()

···

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax
http://taxes.yahoo.com/

Why dosen't the following print to my printer?
It does print 'Print Routine Here' on the screen.

The wxPython printing framework is not exactly intuitive, so don't
feel bad about missing this, but in the first place, wxPrintData is
NOT the data to be printed, but rather "a variety of information
related to printers and printer device contexts as part of the
mechanism for transferring data between the print dialogs and the
application."

What you need is a wxPrintout or wxHtmlPrintout. Try this:

    def OnFilePrint(self, evt):
        self.printData = wxPrintData()
        self.printData.SetPaperId(wxPAPER_LETTER)
        pdd = wxPrintDialogData()
        pdd.SetPrintData(self.printData)
        printer = wxPrinter(pdd)

          printout = wxHtmlPrintout()
          printout.SetHtmlText(self.control.GetValue())
          printer.Print(parent, printout, prompt=FALSE)
          printout.Destroy()

···

--- DJ Webre <d_webre@yahoo.com> wrote:

=====
Donnal Walter
Arkansas Children's Hospital

__________________________________________________
Do You Yahoo!?
Yahoo! Tax Center - online filing with TurboTax