5 ctx_error_func (GPContext *context, const char *format, va_list args, void *data)
7 fprintf (stderr, "\n");
8 fprintf (stderr, "*** Contexterror *** \n");
9 vfprintf (stderr, format, args);
10 fprintf (stderr, "\n");
15 ctx_status_func (GPContext *context, const char *format, va_list args, void *data)
17 vfprintf (stderr, format, args);
18 fprintf (stderr, "\n");
22 GPContext* sample_create_context() {
25 /* This is the mandatory part */
26 context = gp_context_new();
28 /* All the parts below are optional! */
29 gp_context_set_error_func (context, ctx_error_func, NULL);
30 gp_context_set_status_func (context, ctx_status_func, NULL);
33 gp_context_set_cancel_func (p->context, ctx_cancel_func, p);
34 gp_context_set_message_func (p->context, ctx_message_func, p);
35 if (isatty (STDOUT_FILENO))
36 gp_context_set_progress_funcs (p->context,
37 ctx_progress_start_func, ctx_progress_update_func,
38 ctx_progress_stop_func, p);