[gtkada] Gtk.Adjustment.Gtk_New

Preben Randhol randhol at pvv.org
Wed Aug 13 12:04:49 CEST 2003


Thomas De Contes <d.l.tDeContes at free.fr> wrote on 13/08/2003 (11:54) :
> >But why don't you use a spin button?
> 
> i am :-)
> 
> isn't it Gtk.Adjustment.Gtk_New to set a spin button ??

If you mean to change it after it is created, yes. If you mean to create
a spin button you can do:

   Gtk_New (Spinbutton1_Adj, 30.0, 0.0, 100.0, 1.0, 10.0, 10.0);
   Gtk_New (Window1.Spinbutton1, Spinbutton1_Adj, 1.0, 0);
   Set_Invisible_Char (Window1.Spinbutton1, UTF8_Get_Char (""));
   Set_Numeric (Window1.Spinbutton1, False);
   Set_Update_Policy (Window1.Spinbutton1, Update_Always);
   Set_Wrap (Window1.Spinbutton1, False);
   Add (Window1, Window1.Spinbutton1);

But if it only to set the integers you simply need to do:

   Gtk_New (Spinbutton1_Adj,
            Gdouble (Your_Integer_Varable),
            Gdouble (Your_Integer_Varable2),

  etc...

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



More information about the gtkada mailing list