gtk_print_operation_run() blocks and ignores callback



I want to print out some vectordata using GTK/Linux. That's what I already have:


GtkPrintOperation *op;

op = gtk_print_operation_new();
gtk_print_operation_set_n_pages(op, 1);
gtk_print_operation_set_unit (op,GTK_UNIT_POINTS);
g_signal_connect (op, "draw_page", G_CALLBACK(draw_page), NULL);
if (data->config.m_printparams==1) gtk_print_operation_run(op,
GTK_PRINT_OPERATION_ACTION_PRINT,NULL, NULL);
else gtk_print_operation_run (op,
GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,NULL, NULL);

draw_page() of course exists as well:

static void draw_page (GtkPrintOperation *operation,GtkPrintContext
*context,int page_nr)
{
   GtkPrintSettings *settings;

   cairo_t *cr = gtk_print_context_get_cairo_context (context);
   settings = gtk_print_operation_get_print_settings (operation);
   ...do my printing stuff here...
}

Unfortunately it does not work, gtk_print_operation_run() blocks
forever and draw_page() is never called. Any ideas what could be
wrong?

Thanks!


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]