Date: Wed, 24 Apr 2002 08:24:43 -0700 (PDT)
From: DJ Webre <d_webre@yahoo.com>
Subject: Fwd: Print text from wxTextCtrl using PrintFramework
To: wxpython-users <wxpython-users@lists.wxwindows.org>> Date: Tue, 23 Apr 2002 15:15:57 -0700 (PDT)
> From: DJ Webre <d_webre@yahoo.com>
> Subject: Print text from wxTextCtrl using PrintFramework
> To: wxpython-users <wxpython-users@lists.wxwindows.org>
>
> I am trying to print from wxTextCtrl using PrintFramework as
> suggested
> by Robin Dunn on Jul 3, 2001 (Question about the PrintFramework).
>
> The following code gives me an error
>
> AttributeError: MainWindow instance has no attribute 'canvas'.
>
> Any assistance is appreciated.
> ____________________________24 Apr 2002
Based on Robin Dunn's comment, I changed my code as follows:
def OnFilePrint(self, evt): # Print
prntxtctrl = PrintFramework.MyPrintout(self,
self.control.GetValue())
self.printData = wxPrintData()
self.printData.SetPaperId(wxPAPER_LETTER)
pdd = wxPrintDialogData()
pdd.SetPrintData(self.printData)
printer = wxPrinter(pdd)
==> self.canvas = prntxtctrl.canvas
==> self.log = prntxtctrl.log
printout = PrintFramework.MyPrintout(self.canvas, self.log)
if not printer.Print(self, printout):
wxMessageBox("Printer Problem")
else:
self.printData =
printer.GetPrintDialogData().GetPrintData()
printout.Destory()____
Upon running this, I get the following error:
File: ... \PrintFramework.py, Line 42 in GePageInfo
self.log.WriteText
("wxPrintout.GetPageInfo\n")
Attribute Error: 'str' object has no attribute 'WriteText'TypeError: GetPageInfo should return a tuple of 4 integers
Upon checking with "wxWindows Reference" in the "wxPython Notes" I
notice that GetPageInfo is not implemented in wxPython.Can you tell me when GetPageInfo will be implemented?
Also, is there anything in my coding I should change after
GetPageInfo > is implemented?Thanks again for your assistance.
From what little exposure I have had to wxPython, I beleive it is
great. I tried Java and Xbasic but so far wxPython is my choice.Keep up the good work.
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/
···
--- DJ Webre <d_webre@yahoo.com> wrote:
--- DJ Webre <d_webre@yahoo.com> wrote:
__________________________________________________
Do You Yahoo!?
Yahoo! Games - play chess, backgammon, pool and more
http://games.yahoo.com/