[gtkada] Wrong placement of Grab_Focus in source code from Gate

Preben Randhol randhol at pvv.org
Thu May 3 15:08:29 CEST 2001


I'm using Gtkada 1.2.11 on Debian GNU/Linux and I noticed that the
source gate produces has a flaw. The problem is if you have several
buttons, but want one to be the one with the focus initially. Below I
have included some code from gate:

...skipping...
   Grab_Focus (Information_Dialog.Ok_Button);
   Add (Information_Dialog.Gui_Hbuttonbox, Information_Dialog.Ok_Button);

this will not make the OK_Button the one with the focus, unless you do
it like this:

...skipping...
   Add (Information_Dialog.Gui_Hbuttonbox, Information_Dialog.Ok_Button);
   Grab_Focus (Information_Dialog.Ok_Button);

that is the Grab_Focus must come after the button is packed or added to
the parent.

-- 
Preben Randhol ------------------- http://www.pvv.org/~randhol/ --
                 «For me, Ada95 puts back the joy in programming.»




More information about the gtkada mailing list