Rocksolid Light

Welcome to RetroBBS

mail  files  register  newsreader  groups  login

Message-ID:  

Save yourself from the 'Gates' of hell, use Linux." -- like that one. -- The_Kind @ LinuxNet


devel / comp.lang.ada / Re: Printing with Gtk runs but produces only empty pages

SubjectAuthor
* Printing with Gtk runs but produces only empty pagesldries46
`- Re: Printing with Gtk runs but produces only empty pagesldries46

1
Printing with Gtk runs but produces only empty pages

<nnd$7cb04156$277d633d@640fc264714dd304>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9278&group=comp.lang.ada#9278

  copy link   Newsgroups: comp.lang.ada
Date: Tue, 24 Jan 2023 17:01:38 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101
Thunderbird/102.6.1
Newsgroups: comp.lang.ada
Content-Language: en-GB
From: bertus.dries@planet.nl (ldries46)
Subject: Printing with Gtk runs but produces only empty pages
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <nnd$7cb04156$277d633d@640fc264714dd304>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!newsreader4.netcologne.de!news.netcologne.de!peer02.ams1!peer.ams1.xlned.com!news.xlned.com!peer01.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe004.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 57
Injection-Date: Tue, 24 Jan 2023 17:01:38 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 2698
 by: ldries46 - Tue, 24 Jan 2023 16:01 UTC

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?

Re: Printing with Gtk runs but produces only empty pages

<nnd$37c91dd4$6d125dc5@936ee7c06dadaab8>

  copy mid

https://www.rocksolidbbs.com/devel/article-flat.php?id=9284&group=comp.lang.ada#9284

  copy link   Newsgroups: comp.lang.ada
Date: Wed, 25 Jan 2023 14:11:37 +0100
MIME-Version: 1.0
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1
Subject: Re: Printing with Gtk runs but produces only empty pages
Newsgroups: comp.lang.ada
References: <nnd$7cb04156$277d633d@640fc264714dd304>
Content-Language: en-GB
From: bertus.dries@planet.nl (ldries46)
In-Reply-To: <nnd$7cb04156$277d633d@640fc264714dd304>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Message-ID: <nnd$37c91dd4$6d125dc5@936ee7c06dadaab8>
Organization: KPN B.V.
Path: i2pn2.org!i2pn.org!weretis.net!feeder8.news.weretis.net!news.uzoreto.com!feeder.usenetexpress.com!tr3.eu1.usenetexpress.com!81.171.65.16.MISMATCH!peer03.ams4!peer.am4.highwinds-media.com!news.highwinds-media.com!feed.abavia.com!abe006.abavia.com!abp001.abavia.com!news.kpn.nl!not-for-mail
Lines: 61
Injection-Date: Wed, 25 Jan 2023 14:11:39 +0100
Injection-Info: news.kpn.nl; mail-complaints-to="abuse@kpn.com"
X-Received-Bytes: 3019
 by: ldries46 - Wed, 25 Jan 2023 13:11 UTC

Op 24-1-2023 om 17:01 schreef ldries46:
> 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?
>
The problem is solved by rearranging the program and because the
debugger in GNAT 23.0W works not correctl. Only one problem has not been
solved see a new question


devel / comp.lang.ada / Re: Printing with Gtk runs but produces only empty pages

1
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor