class Printing.Printable

Printable is an abstract base class for components that provide an implementation of the Print command.

If enabled for the instance concerned, components inheriting from this class will automatically enable the Print command and will print themselves in response to it.

Printing behaviour is controlled by the printable property. Setting this property to false causes the Print command to be ignored and passed on to the Document or Application. You may need to do this if you want your document to be printed in a different way than it appears on screen. See the Printing topic for more information.

Printable components in the PyGUI framework include View, ScrollableView and TextEditor.

Note: The Printable class is designed for internal use by the PyGUI framework only; you should not inherit directly from it yourself. To implement a printable view, base it on one of the concrete component classes listed above.

Properties

printable
If true, the Print command is handled by this component, otherwise it is passed on to the next handler. Defaults to true.

page_setup
Read only. The PageSetup instance to be used when printing this component. By default, a page_setup attribute is looked for on the associated model, if any. If there is no model, or it does not have a page_setup attribute, or its value is None, the application's default PageSetup instance is used. You can customise this behaviour by overriding the get_page_setup() method.

print_title
Read only. Title to use for print jobs. The usage of this property is platform-dependent. Defaults to the title of the containing Window. You can customise it by overriding the get_print_title() method.

Methods

print_cmd()
Implements the standard Print command by calling print_view() with the value of the page_setup property.
print_view(page_setup, prompt = True)
Prints the contents of the component using the specified PageSetup object. If prompt is true, a printing dialog is first displayed, otherwise the printing operation is started immediately without user interaction.

Abstract Methods

get_page_setup()
Override this to customise the way the PageSetup object is obtained when handling the Print command.

get_print_title()
Determines the value of the print_title property.
---