Gtkada垂直分隔符未显示

时间:2013-08-29 11:45:41

标签: gtk ada

我正在使用Gtkada在Ada中使用HMI,我想创建一个垂直分隔符(Gtk_Vseparator),但它没有显示。我把它放在一个对齐中,当我在对齐中添加一个按钮时,但是当我添加分隔符时,它不会,我不知道为什么。

这是我的代码:

   Win                  : Gtk_Window;
   Notebook             : Gtk_Notebook;
   Notebook_Label       : Gtk_Label;
   Box_0                : Gtk_Vbox;
   Alignment_1          : Gtk_Alignment;
   Generate_Button      : Gtk_Button;
   Box_1                : Gtk_Hbox;
   Box_2_Add            : Gtk_Vbox;
   Alignment_2          : Gtk_Alignment;
   Add_Delete_Separator : Gtk_Vseparator;
   Box_2_Delete         : Gtk_Vbox;

   Init;
   Gtk_New (Win, Window_Toplevel);
   Gtk_New (Notebook);
   Gtk_New (Notebook_Label, "Generation");
   Gtk_New_Vbox (Box_0, Homogeneous => False, Spacing => 20);
   Gtk_New (Alignment_1, 0.5, 0.5, 0.0, 0.0);
   Gtk_New (Generate_Button, "Generate model");
   Gtk_New_Hbox (Box_1, Homogeneous => False);
   Gtk_New_Vbox (Box_2_Add, Homogeneous => False);
   Gtk_New (Alignment_2, 0.5, 0.5, 0.0, 0.0);
   Gtk_New_Vseparator (Add_Delete_Separator);
   Gtk_New_Vbox (Box_2_Delete, Homogeneous => False);

   Add_Delete_Separator.Show;
   Alignment_2.Add (Add_Delete_Separator);
   Box_1.Pack_End (Box_2_Add, Expand => True, Fill => True);
   Box_1.Pack_End (Alignment_2, Expand => True, Fill => True);
   Box_1.Pack_End (Box_2_Delete, Expand => True, Fill => True);
   Alignment_1.Add (Generate_Button);
   Box_0.Pack_End (Box_1, Expand => True, Fill => True);
   Box_0.Pack_End (Alignment_1, Expand => False, Fill => True); 

   Notebook.Append_Page (Box_0, Notebook_Label);
   Win.Set_Title ("Generator");
   Win.Set_Default_Size (1200, 800);
   Win.Set_Position (Win_Pos_Center);
   Win.Add (Notebook);
   Win.Show_All;

   Main;

1 个答案:

答案 0 :(得分:2)

Vseparator没有最低要求的身高。因此,您需要告知对齐位置,它应该使用所有可用的垂直空间:

Gtk_New (Alignment_2, 0.5, 0.5, 0.0, 1.0);

顺便提一下,请将您的代码发布为SSCCE。剥离begin等不会使代码更具可读性。