summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-04-22 15:59:22 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2020-04-22 16:01:33 +0200
commit2878fa95ab4e30046472a8c1f7576aa6a39f8ba5 (patch)
treeb37fec88aee27a8e1095b649f10017d44ef69d60 /test
parentb38317b8a5c5aa6b37d4eb559b094da4e31d9a44 (diff)
Add optional argument to Fl_Printer::begin_job() to inform caller when an error occurs.
This solves an issue raised in fltk.general : Fl_Printer errors - how can I interpret them? https://www.fltk.org/newsgroups.php?s38419+gfltk.general+v38427
Diffstat (limited to 'test')
-rw-r--r--test/device.cxx7
1 files changed, 4 insertions, 3 deletions
diff --git a/test/device.cxx b/test/device.cxx
index 964e4da84..6ddda8761 100644
--- a/test/device.cxx
+++ b/test/device.cxx
@@ -612,21 +612,22 @@ void copy(Fl_Widget *, void *data) {
if (strcmp(operation, "Fl_Printer") == 0 || strcmp(operation, "Fl_PostScript_File_Device") == 0) {
Fl_Paged_Device *p;
int err;
+ char *err_message = NULL;
if (strcmp(operation, "Fl_Printer") == 0) {
p = new Fl_Printer();
- err = p->start_job(1);
+ err = p->begin_job(1, NULL, NULL, &err_message);
}
else {
p = new Fl_PostScript_File_Device();
err = ((Fl_PostScript_File_Device*)p)->start_job(1);
}
if (!err) {
- p->start_page();
+ p->begin_page();
if (target->as_window()) p->print_window(target->as_window());
else p->print_widget(target);
p->end_page();
p->end_job();
- }
+ } else if (err > 1 && err_message) {fl_alert("%s", err_message); delete[] err_message;}
delete p;
}
}