gtk.PageSetup — an object that stores page setup information (new in PyGTK 2.10)
class gtk.PageSetup(gobject.GObject): |
Functions
|
This class is available in PyGTK 2.10 and above.
A gtk.PageSetup object stores the page size, orientation and margins. The idea is that you can get one of these from the page setup dialog and then pass it to the gtk.PrintOperation when printing. The benefit of splitting this out of the gtk.PrintSettings is that these affect the actual layout of the page, and thus need to be set long before user prints.
The margins specified in this object are the "print margins", i.e. the parts of the page that the printer cannot print on. These are different from the layout margins that a word processor uses; they are typically used to determine the minimal size for the layout margins.
To obtain a gtk.PageSetup use the gtk.PageSetup() constructor to get the defaults, or use the gtk.print_run_page_setup_dialog() function to show the page setup dialog and receive the resulting page setup. An example page setup function is:
def do_page_setup(): if settings == None: settings = gtk.PrintSettings() page_setup = gtk.print_run_page_setup_dialog(main_window, page_setup, settings) |
|
Returns : | a new gtk.PageSetup. |
This constructor is available in PyGTK 2.10 and above.
Creates a new gtk.PageSetup.
|
Returns : | a copy of this page setup |
This method is available in PyGTK 2.10 and above.
The copy() method copies this gtk.PageSetup.
|
Returns : | the page orientation |
This method is available in PyGTK 2.10 and above.
The get_orientation() method returns the page orientation of the gtk.PageSetup. The return value must be one of the GTK Page Orientation Constants.
|
orientation : | one of the GTK Page Orientation Constants |
This method is available in PyGTK 2.10 and above.
The set_orientation() method sets the page orientation of the gtk.PageSetup to the value specified by orientation. The value of orientation must be one of the GTK Page Orientation Constants
|
Returns : | the paper size |
This method is available in PyGTK 2.10 and above.
The get_paper_size() method gets the paper size of the gtk.PageSetup.
|
size : | a gtk.PaperSize |
This method is available in PyGTK 2.10 and above.
The set_paper_size() method sets the paper size of the page setup without changing the margins. See the set_paper_size_and_default_margins() method.
|
unit : | the unit for the return value - one of the GTK Unit Constants |
Returns : | the top margin |
This method is available in PyGTK 2.10 and above.
The get_top_margin() method returns the top margin in units of unit.
|
margin : | the new top margin in units of unit |
unit : | the units for margin - one of the GTK Unit Constants |
This method is available in PyGTK 2.10 and above.
The set_top_margin() method sets the top margin of the page setup to the value specified by margin in the units specified by unit.
|
unit : | the unit for the return value |
Returns : | the bottom margin |
This method is available in PyGTK 2.10 and above.
The get_bottom_margin() method gets the bottom margin in units of unit.
|
margin : | the new bottom margin in units of unit |
unit : | the units for margin - one of the GTK Unit Constants |
This method is available in PyGTK 2.10 and above.
The set_bottom_margin() method sets the bottom margin of the page setup to the value specified by margin using the units specified by unit.
|
unit : | the unit for the return value |
Returns : | the left margin |
This method is available in PyGTK 2.10 and above.
The get_left_margin() method gets the left margin in units of unit.
|
margin : | the new left margin in units of unit |
unit : | the units for margin - one of the GTK Unit Constants |
This method is available in PyGTK 2.10 and above.
The set_left_margin() method sets the left margin of the page setup to the value specified by margin using the units specified by unit.
|
unit : | the unit for the return value - one of the GTK Unit Constants |
Returns : | the right margin |
This method is available in PyGTK 2.10 and above.
The get_right_margin() method gets the right margin in units of unit.
|
margin : | the new right margin in units of unit |
unit : | the units for margin - one of the GTK Unit Constants |
This method is available in PyGTK 2.10 and above.
The set_right_margin() method sets the right margin of the page setup to the value specified by margin using the units specified by unit.
|
size : | a gtk.PaperSize |
This method is available in PyGTK 2.10 and above.
The set_paper_size_and_default_margins() method sets the paper size of the page setup to the value specified by size and modifies the margins according to the new paper size.
|
unit : | the unit for the return value - one of the GTK Unit Constants |
Returns : | the paper width. |
This method is available in PyGTK 2.10 and above.
The get_paper_width() method returns the paper width in units of unit.
Note that this function takes orientation, but not margins into consideration. See the get_page_width() method.
|
unit : | the unit for the return value - one of the GTK Unit Constants |
Returns : | the paper height. |
This method is available in PyGTK 2.10 and above.
The get_paper_height() method returns the paper height in units of unit.
Note that this function takes orientation, but not margins into consideration. See the get_page_height() method.
|
unit : | the unit for the return value - one of the GTK Unit Constants |
Returns : | the page width. |
This method is available in PyGTK 2.10 and above.
The get_page_width() method returns the page width in units of unit.
Note that this function takes orientation and margins into consideration. See the get_paper_width() method.
|
unit : | the unit for the return value - one of the GTK Unit Constants |
Returns : | the page height. |
This method is available in PyGTK 2.10 and above.
The get_page_height() method returns the page height in units of unit.
Note that this function takes orientation and margins into consideration. See the get_paper_height() method.
|
parent : | transient parent, or None |
page_setup : | an existing gtk.PageSetup, or None |
settings : | a gtk.PrintSettings |
Returns : | a new gtk.PageSetup |
Runs a page setup dialog, letting the user modify the values from page_setup. If the user cancels the dialog, the returned gtk.PageSetup is identical to the passed in page_setup, otherwise it contains the modifications done in the dialog.
Note that this function may use a recursive mainloop to show the page setup dialog.