I’m developing an application using the GtkPrintOperation.
I can print OK but the print dialog box does not allow me to change many of the parameters (such as orientation). See this dialog I get using the application
Other applications do dot prohibit me from changing these settings. What is going wrong here?
This occurs on all printers and on “print to file”.
I’ve set up the code almost identically to the examples …
static GtkPrintSettings *settings = NULL;
void
CB_BtnMPrint (GtkButton *wButton, tGlobal *pGlobal)
{
GtkPrintOperation *print;
GtkPrintOperationResult res;
static gboolean bInitial = TRUE;
if( bInitial ) {
settings = gtk_print_settings_new ();
gtk_print_settings_set_orientation ( settings, GTK_PAGE_ORIENTATION_LANDSCAPE );
bInitial = FALSE;
}
print = gtk_print_operation_new ();
if (settings != NULL)
gtk_print_operation_set_print_settings (print, settings);
g_signal_connect (print, "begin_print", G_CALLBACK (begin_print), pGlobal);
g_signal_connect (print, "draw_page", G_CALLBACK (draw_page), pGlobal);
res = gtk_print_operation_run (print, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG,
GTK_WINDOW(g_hash_table_lookup ( pGlobal->widgetHashTable, (gconstpointer)"WID_hp8753c_main") ), NULL);
if (res == GTK_PRINT_OPERATION_RESULT_APPLY)
{
if (settings != NULL)
g_object_unref (settings);
settings = g_object_ref (gtk_print_operation_get_print_settings (print));
}
g_object_unref (print);
}