[gtkada] Notebook question

Bobby D. Bryant bdbryant at mail.utexas.edu
Tue Oct 8 09:48:58 CEST 2002


On 2002.09.30 10:38:32 -0600 manuel.op.de.coul at eon-benelux.com wrote:

> I'd like to change the widget for a particular
> page in a notebook. I found the function Get_Child,
> but not a corresponding constructor Set_Child.
> How do I do this?

I am not up to the most recent version of GtkAda, but I thought I'd try 
to answer since no one else has.  The following applies to v. 1.2.11.

I have not been modifying the page children directly.  Instead, I use 
Prepend_Page, Insert_Page, or Append_Page to add new pages with their 
own children.  If the new page is to replace an old one I just use 
Remove_Page and then Insert_Page for the substitution.

This may not be the most elegant approach, depending on exactly what 
you are trying to do.  If you want to substitute something in a page 
directly, remember that Get_Child gives you an access handle, so you 
should be able to manipulate the child directly by means of that.  If 
you cannot modify the child widget directly in the way you need, try 
creating a container to serve as the child when you first create the 
page, use Get_Child to grab a handle on the container, and then modify 
the contents of the container using the container's
own manipulation routines.  [N.B. - I have used containers as page 
children, but I have not tried substituting their contents afterward.]

Hopefully someone will pitch in with a better answer.

Bobby Bryant
Austin, Texas




More information about the gtkada mailing list