[gtkada] Creating a text-editing screen

Dmitry A. Kazakov mailbox at dmitry-kazakov.de
Mon Jun 1 11:14:03 CEST 2009


On Mon, 1 Jun 2009 12:39:04 +0800, you wrote:

> I am coding a composite widget which is intended to include a text-editing
> screen.
> 
> ----------------------------------------------------------
> -- RENAME GADGETCODE.TXT TO GADGETCODE.ZIP AND UNZIP IT --
> ----------------------------------------------------------
> 
> Compare the appearance of the widget as created by Glade_2 with the widget
> created my my code.  I used Gtk.Text_View for the screen widget as I think
> Glade did.  I cannot find procedures in GtkAda to make the coded version the
> same as the Glade version.
> 
> How do I set a frame around the text screen in my widget?
> How do I set a space between the text screen and the frame in which it sits?

Try Set_Border_Width on Gtk_Text_View or else on its Gtk_Frame.

But normally it works as expected without that stuff. You would do
something like:

   Scroll : Gtk_Scrolled_Window;
   View : Gtk_Text_View;
   Frame  : Gtk_Frame;
begin
   Gtk_New (Frame, "Add Text");  -- Frame
   Set_Shadow_Type (Frame, Shadow_In); -- For example

   Gtk_New (Scroll);  -- Scroll bars for the text view
   Set_Policy (Scroll, Policy_Automatic, Policy_Automatic);
   Add (Frame, Scroll);

   Gtk_New (View);  -- The text view
   Add (Scroll, View);

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



More information about the gtkada mailing list