summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorGustavo J. A. M. Carneiro <gjc@src.gnome.org>2006-06-15 19:01:22 +0000
committerGustavo J. A. M. Carneiro <gjc@src.gnome.org>2006-06-15 19:01:22 +0000
commitfff459450046a06b05dc94339edc61c200dd61d6 (patch)
tree92926dd195b4243a3c77dcad85e38ed360f71d10 /examples
parentf058bfc057f8599d55462c626ba9b654c7efa46e (diff)
downloadpygtk-fff459450046a06b05dc94339edc61c200dd61d6.tar.gz
update printing example
Diffstat (limited to 'examples')
-rw-r--r--examples/pygtk-demo/demos/print_editor.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/examples/pygtk-demo/demos/print_editor.py b/examples/pygtk-demo/demos/print_editor.py
index 4ed8e056..7b7ae106 100644
--- a/examples/pygtk-demo/demos/print_editor.py
+++ b/examples/pygtk-demo/demos/print_editor.py
@@ -160,7 +160,7 @@ class PrintData:
def begin_print(operation, context, print_data):
width = context.get_width()
height = context.get_height()
- print_data.layout = context.create_layout()
+ print_data.layout = context.create_pango_layout()
print_data.layout.set_font_description(pango.FontDescription("Sans 12"))
print_data.layout.set_width(int(width*pango.SCALE))
print_data.layout.set_text(print_data.text)
@@ -196,7 +196,7 @@ def draw_page(operation, context, page_nr, print_data):
except IndexError:
end = print_data.layout.get_line_count()
- cr = context.get_cairo()
+ cr = context.get_cairo_context()
cr.set_source_rgb(0, 0, 0)
@@ -247,7 +247,7 @@ def do_print(action):
print_.connect("draw_page", draw_page, print_data)
try:
- res = print_.run(main_window)
+ res = print_.run(gtk.PRINT_OPERATION_ACTION_PRINT_DIALOG, main_window)
except gobject.GError, ex:
error_dialog = gtk.MessageDialog(main_window,
gtk.DIALOG_DESTROY_WITH_PARENT,