comp.lang.ada
 help / color / mirror / Atom feed
* Printing with Gtk runs but produces only empty pages
@ 2023-01-24 16:01 ldries46
  2023-01-25 13:11 ` ldries46
  0 siblings, 1 reply; 2+ messages in thread
From: ldries46 @ 2023-01-24 16:01 UTC (permalink / raw)


I am trying to crate a Gtk print procedure,
 From the point I start creating Print_Op and Print_Set the code I use is:

          Print_Op := new Gtkada_Print_Operation_Record;
          Gtkada.Printing.Initialize (Print_Op);
          Gtk_New(Print_Set);
          Set_Current_Page (Print_Op, 1);
          Number := long_float(last_line) / long_float(delta_lines);
          Number := long_float'Ceiling(Number);
          nr_Pages := Gint(Number);
          Set_N_Pages (Print_Op, nr_Pages + 1);

I just put a breakpoint at the line after Set_N_Pages. I also found the 
following parameters. If I delete the + 1 in the last line get message 
that possily point to adres 0*0

nr                 100
delta_lines    56
last_line         14
nr_Pages          1

On the Debugging Console I got the following messages:

(gdb) show lang
&"show lang\n"
~"The current source language is \"auto; currently ada\".\n"
^done
(gdb)
ptype &Print_Op
&"ptype &Print_Op\n"
~"type = access access new 
gtk.print_operation.gtk_print_operation_record with record null; end 
record\n"
^done
(gdb)
-data-evaluate-expression "Print_Op"
^done,value="0xf8eb730"
(gdb)
(

The folowing code is:

          Set_Use_Full_Page(Print_Op, true);
          Set_Unit (Print_Op, points);
          Print_Op.Set_Print_Settings(Print_Set);
          On_Draw_Page(Print_Op, Draw);
          Result := Connect_and_Run(Print_Op ,Action_Print_Dialog, 
Main_Window);

The overall result is that the program does not show a failure but also 
does not print any thing except an empty page.
As I try to debug something not all parameters displayed in the 
variables window when I am running the debugger.

Can anyone tell me wher to find a working example?

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-01-25 13:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-24 16:01 Printing with Gtk runs but produces only empty pages ldries46
2023-01-25 13:11 ` ldries46

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox