[gtkada] Gtk_Spin_Button and focus out signal.

Preben Randhol randhol at pvv.org
Thu May 9 15:55:33 CEST 2002


"Clark, G L" <g.l.clark at lmco.com> wrote on 09/05/2002 (00:59) :
>    The solution is to emit an "activate" signal within the user defined
> focus_out even handler.  This will sync the value in the field with the
> value of the Spin_Button's adjustment.  It will also force the value into
> the correct range as expected.
>  
> 	procedure On_Some_Spin_Button_Focus_Out
> 	  (Object : access Gtk_Spin_Button_Record'Class) is
> 	
> 	begin
>         Spin_Button_Callback.Emit_By_Name(Object, "activate");
>         -- Do validation or storage or any other necessary operations.
> 	end On_Some_Spin_Button_Focus_Out;


Hmm I'll check this later. I have two
spin buttons:

Start [  ]   (valid range is set to 1..End-1)
End   [  ]   (valid range is Start+1..End)

So when I focus in on the End spin button I update it's range as to what
the Start button is set to.

But isn't there a way to say that your callback should be called after
other callbacks? I seem to recall this. Perhaps you can only set this

   Spin_Button_Callback.Connect (Window.Spin_Button, "focus_out",
        Spin_Button_Callback.To_Marshaller (On_Spin_Button_Clicked'Access),
        True);
        ^^^^
        This should make the callback be called after others if I
        haven't misunderstood.

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




More information about the gtkada mailing list