From: Pradeep B on
On Fri, Jan 22, 2010 at 6:48 AM, Ethan Furman <ethan(a)stoneleaf.us> wrote:
> Peter wrote:
>>
>> On Jan 15, 9:12 am, Kevin Walzer <k...(a)codebykevin.com> wrote:
>>>>
>>>> On Jan 15, 6:24 am, Mark Roseman<m...(a)markroseman.com>  wrote:
>>>>>
>>>>>  Peter<peter.milli...(a)gmail.com>  wrote:
>>>>>>
>>>>>> Besides, the book is mainly about using Python with Tkinter - and
>>>>>> Tkinter hasn't changed that much since 2000, so I believe it is just
>>>>>> as relevant today as it was back then.
>
>>>>> I'd say that Tkinter has substantially changed - with the introduction
>>>>> of the 'ttk' themed widgets.  I cover these in my tutorial
>>>>> athttp://www.tkdocs.com
>
>>> Another book I've found very helpful for learning Tkinter is Programming
>>> Python by Mark Lutz--a lot of coverage there of GUI development.
>>>
>>
>> Another possible consideration when choosing a GUI to learn Python -
>> will you want to print from within your GUI application?
>
> Excellent point.
>
> Many thanks to all who responded, especially for the reminder of the gui
> sections in Programming Python (forgot I had that book!).  I'll start by
> going over that again, and we'll see how confident I feel afterwards.  ;)
>
> ~Ethan~
> --
> http://mail.python.org/mailman/listinfo/python-list
>



Is printing from GUI still a 'not-happening' thing with Tkinter ? I
have just started learning it.



--

|_|0|_|
|_|_|0|
|0|0|0|

http://picasaweb.google.com/pradeepbpin
From: Kevin Walzer on

> Is printing from GUI still a 'not-happening' thing with Tkinter ? I
> have just started learning it.

Tkinter doesn't wrap native printing API's. There are a few extensions
that do it, but they are platform specific and not complete.

The usual ways of printing are like this:

1. If you're outputting data from the text widget, write that to a
temporary text file and print via lpr.

2. If you're outputting data from the canvas, write that to a temporary
postscript file and print via lpr.

This is on Unix/MacOS. Not sure what the equivalent API on Windows is.

--Kevin

--
Kevin Walzer
Code by Kevin
http://www.codebykevin.com
From: Pradeep B on
On Sat, May 29, 2010 at 7:33 PM, Kevin Walzer <kw(a)codebykevin.com> wrote:

> Tkinter doesn't wrap native printing API's. There are a few extensions that
> do it, but they are platform specific and not complete.
>
> The usual ways of printing are like this:
>
> 1. If you're outputting data from the text widget, write that to a temporary
> text file and print via lpr.
>
> 2. If you're outputting data from the canvas, write that to a temporary
> postscript file and print via lpr.
>
> This is on Unix/MacOS. Not sure what the equivalent API on Windows is.
>
> --Kevin
>
> --
> Kevin Walzer
> Code by Kevin
> http://www.codebykevin.com
> --
> http://mail.python.org/mailman/listinfo/python-list
>


Thanx Kevin.

Anybody can throw light on how to do the same in Windows ?

-pradeep


--

|_|0|_|
|_|_|0|
|0|0|0|

http://picasaweb.google.com/pradeepbpin
From: Arndt Roger Schneider on
Pradeep B schrieb:

>On Sat, May 29, 2010 at 7:33 PM, Kevin Walzer <kw(a)codebykevin.com> wrote:
>
>
>
>>Tkinter doesn't wrap native printing API's. There are a few extensions that
>>do it, but they are platform specific and not complete.
>>
>>The usual ways of printing are like this:
>>
>>1. If you're outputting data from the text widget, write that to a temporary
>>text file and print via lpr.
>>
>>2. If you're outputting data from the canvas, write that to a temporary
>>postscript file and print via lpr.
>>
>>This is on Unix/MacOS. Not sure what the equivalent API on Windows is.
>>
>>--Kevin
>>
>>--
>>Kevin Walzer
>>Code by Kevin
>>http://www.codebykevin.com
>>--
>>http://mail.python.org/mailman/listinfo/python-list
>>
>>
>>
>
>
>Thanx Kevin.
>
>Anybody can throw light on how to do the same in Windows ?
>
>-pradeep
>
>
>
>
The conventional --crude-- way is to take the bitmap of a
window and to stretchDIBBitBlt it onto the printer device in windows
and osx. Native printer dialogs do exist for both platforms ...

When you do not need a printer dialog:
Convert the Tk-GUI to SVG, then wrap it into a fo-xml wrapper
--fo accepts inline SVG-- and use fop for printing.
This approach works cross-platform, albeit you need a Java
intallation (fop is a Java application).

You can use http://jeszra.sourceforge.net to generate SVG for a complete
Tk-GUI.
In addition. there is a python/tkinter SVG export project for the Tk canvas
--search the tkinter wiki.


-roger