[gtkada] Size of Spin-Buttons. Format of Help-Texts.

Martin Klaiber martinkl at zedat.fu-berlin.de
Sat Feb 8 16:32:59 CET 2003


Hi,

I'm new to GtkAda and new to this list. So forgive me, if my questions
are stupid. I use the GtkAda-version included in Debian woody, which
is 1.2.12-7.

I want to include a Spin-Button in a window. It is used to choose a
year between 2000 and 2005. But either it is too narrow or too wide.
Here is what I do:

  procedure On_Year_Activate (Object : access Gtk_Menu_Item_Record'Class) is
    Win : Gtk_Window;
    VBox, HBox : Gtk_Box;
    Label : Gtk_Label;
    Spin_Button : Gtk_Spin_Button;
    Adjustment : Gtk_Adjustment;
    Ok_Button, Esc_Button : Gtk_Button;
  begin
    Gtk_New (Win);
    Gtk_New_VBox (VBox, True);
    Set_USize (Win, 200, 150);
    Set_Position (Win, Win_Pos_Center);
    Add (Win, VBox);
   
    Gtk_New_HBox (HBox);
    Gtk_New (Label, "Year");
    Gtk_New (Adjustment, 2002.0, 2000.0, 2005.0, 1.0, 1.0, 1.0);
    Gtk_New (Spin_Button, Adjustment, 1.0, 0);
    Set_Numeric (Spin_Button, True);
    Pack_Start (HBox, Label, True, False, 0);
    Pack_Start (HBox, Spin_Button, True, False, 0);
    Pack_Start (VBox, HBox, True, False, 0);

    [snip...]

If I insert the Label and the Spin-Button into the HBox like this, the
Spin-Button is too narrow. I can't see all four digits of the Year.

If I insert the Spin-Button with    

   Pack_Start (HBox, Spin_Button, True, True, 0);
   
it's too wide. I see more than the space needed for four digits. Is
there a way to adjust it in such a way that it takes exactly the
space, which is needed to show four digits (from 2000 to 2005)?

And my second question: I want to write help-texts which work context
sensitive. Is such a feature supported by GtkAda, and if so: which is
the format, the help-texts should be written in?

Thank you very much in advance,
Martin



More information about the gtkada mailing list