gtk.PageSetupan object that stores page setup information (new in PyGTK
2.10)Synopsisgtk.PageSetupgobject.GObjectgtk.PageSetupcopyget_orientationset_orientationorientationget_paper_sizeset_paper_sizesizeget_top_marginunitset_top_marginmarginunitget_bottom_marginunitset_bottom_marginmarginunitget_left_marginunitset_left_marginmarginunitget_right_marginunitset_right_marginmarginunitset_paper_size_and_default_marginssizeget_paper_widthunitget_paper_heightunitget_page_widthunitget_page_heightunitto_filefile_nameload_filefile_nameFunctionsgtk.print_run_page_setup_dialogparentpage_setupsettingsgtk.page_setup_new_from_filefile_nameAncestry+-- gobject.GObject
+-- gtk.PageSetup
gtk.PageSetup Signal Prototypesgobject.GObject Signal PrototypesDescriptionThis 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)
Constructorgtk.PageSetupgtk.PageSetupReturns :a new gtk.PageSetup.This constructor is available in PyGTK 2.10 and above.Creates a new gtk.PageSetup.Methodsgtk.PageSetup.copycopyReturns :a copy of this page setupThis method is available in PyGTK 2.10 and above.The copy() method copies this gtk.PageSetup.gtk.PageSetup.get_orientationget_orientationReturns :the page orientationThis 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.PageSetup.set_orientationset_orientationorientationorientation :one of the 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.PageSetup.get_paper_sizeget_paper_sizeReturns :the paper sizeThis method is available in PyGTK 2.10 and above.The get_paper_size() method gets the
paper size of the gtk.PageSetup.gtk.PageSetup.set_paper_sizeset_paper_sizesizesize :a gtk.PaperSizeThis 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.gtk.PageSetup.get_top_marginget_top_marginunitunit :the unit for the return value - one of the
Returns :the top marginThis method is available in PyGTK 2.10 and above.The get_top_margin() method returns the
top margin in units of unit.gtk.PageSetup.set_top_marginset_top_marginmarginunitmargin :the new top margin in units of
unitunit :the units for margin -
one of the 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.gtk.PageSetup.get_bottom_marginget_bottom_marginunitunit :the unit for the return
valueReturns :the bottom marginThis method is available in PyGTK 2.10 and above.The get_bottom_margin() method gets the
bottom margin in units of unit.gtk.PageSetup.set_bottom_marginset_bottom_marginmarginunitmargin :the new bottom margin in units of
unitunit :the units for margin -
one of the 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.gtk.PageSetup.get_left_marginget_left_marginunitunit :the unit for the return
valueReturns :the left marginThis method is available in PyGTK 2.10 and above.The get_left_margin() method gets the
left margin in units of unit.gtk.PageSetup.set_left_marginset_left_marginmarginunitmargin :the new left margin in units of
unitunit :the units for margin -
one of the 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.gtk.PageSetup.get_right_marginget_right_marginunitunit :the unit for the return value - one
of the Returns :the right marginThis method is available in PyGTK 2.10 and above.The get_right_margin() method gets the
right margin in units of unit.gtk.PageSetup.set_right_marginset_right_marginmarginunitmargin :the new right margin in units of
unitunit :the units for margin -
one of the 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.gtk.PageSetup.set_paper_size_and_default_marginsset_paper_size_and_default_marginssizesize :a gtk.PaperSizeThis 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.gtk.PageSetup.get_paper_widthget_paper_widthunitunit :the unit for the return value - one of the
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.gtk.PageSetup.get_paper_heightget_paper_heightunitunit :the unit for the return value - one of the
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.gtk.PageSetup.get_page_widthget_page_widthunitunit :the unit for the return value - one of the
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.gtk.PageSetup.get_page_heightget_page_heightunitunit :the unit for the return value - one of the
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.gtk.PageSetup.to_fileto_filefile_namefile_name :the file to save toReturns :True on success.This method is available in PyGTK 2.12 and above.The to_file() method
saves the information from setup to file_name.gtk.PageSetup.load_fileload_filefile_namefile_name :the filename to read the page setup from.Returns :True on success.This method is available in PyGTK 2.14 and above.
The load_file() method
Reads the page setup from the file file_name. See
to_file.
Functionsgtk.print_run_page_setup_dialoggtk.print_run_page_setup_dialogparentpage_setupsettingsparent :transient parent, or
Nonepage_setup :an existing gtk.PageSetup,
or Nonesettings :a gtk.PrintSettingsReturns :a new gtk.PageSetupRuns 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.gtk.page_setup_new_from_filegtk.page_setup_new_from_filefile_namefile_name :the filename to read the page setup from.Returns :The restored gtk.PageSetupThis function is available in PyGTK 2.12 and above.Reads the page setup from the file file_name. Returns a new
gtk.PageSetup
object with the restored page setup, or None if an error occurred. See
gtk.PageSetup.to_file.