From: ldries46 on
I am trying to create ADA programs in windows XP. Therefore I am using
GTKAda. I cannot find any reference to how to print the info in a TextView
window. I am using the text view window for convienience and have found
various possibilities but not how to print or even how to sned something to
a windows printer.
Can anyone tell me how that must be done

L. Dries


From: Dmitry A. Kazakov on
On Fri, 20 Jun 2008 16:29:48 +0200, ldries46 wrote:

> Therefore I am using
> GTKAda. I cannot find any reference to how to print the info in a TextView
> window.

Gtk's Gtk_Text_View uses the MVC model. That means you have to change the
model in order to make the viewer to show anything. In short you should
modify the text buffer of the widget in order to make Text_View to show it.
For example, you could use Set_Text. See for Gtk_Text_Buffer

http://www.adacore.com/wp-content/files/auto_update/gtkada-docs/gtkada_rm/gtkada_rm/gtk-text_buffer.html

(the function Get_Buffer returns the current text buffer of the widget)

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de
From: ldries46 on
It 's clear to me how to get my text buffer back. Now I want to send it to
the printer within windows, so I want to see for instance the windows
printer dialog to choose my printer (or PDF creator) or a GTK alternative
for it. The last would be better if I want to design my program in a Windows
enviroment and run it also in a Linux enviroment for instance.


"Dmitry A. Kazakov" <mailbox(a)dmitry-kazakov.de> schreef in bericht
news:17ibcqwjp5k8x$.1mqnp1id4k4f9.dlg(a)40tude.net...
> On Fri, 20 Jun 2008 16:29:48 +0200, ldries46 wrote:
>
>> Therefore I am using
>> GTKAda. I cannot find any reference to how to print the info in a
>> TextView
>> window.
>
> Gtk's Gtk_Text_View uses the MVC model. That means you have to change the
> model in order to make the viewer to show anything. In short you should
> modify the text buffer of the widget in order to make Text_View to show
> it.
> For example, you could use Set_Text. See for Gtk_Text_Buffer
>
> http://www.adacore.com/wp-content/files/auto_update/gtkada-docs/gtkada_rm/gtkada_rm/gtk-text_buffer.html
>
> (the function Get_Buffer returns the current text buffer of the widget)
>
> --
> Regards,
> Dmitry A. Kazakov
> http://www.dmitry-kazakov.de


From: Dmitry A. Kazakov on
On Sat, 21 Jun 2008 14:05:53 +0200, ldries46 wrote:

> It 's clear to me how to get my text buffer back. Now I want to send it to
> the printer within windows, so I want to see for instance the windows
> printer dialog to choose my printer (or PDF creator) or a GTK alternative
> for it.

I see it is not GtkTextView, it is printing what you need. GTK+ has
printing API[*]. But AFAIK it is not yet supported in GtkAda 2.10.

You should do these bindings by yourself (which should be not that
difficult) or else wait for some next version of GtkAda. If you are a
paying AdaCore customer, you might ask them to do it for you.
(AdaCore maintains GtkAda)

------------
* http://library.gnome.org/devel/gtk/stable/Printing.html

--
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de