2013-08-29 48 views
0

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

这里是我的代码:

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; 

回答

3

一个Vseparator没有最低所需的高度。因此,你需要告诉你的地方它,它应该利用一切可以利用垂直空间的对齐方式:

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

顺便说一句,请把你的代码SSCCE。剥离begin等不会使代码更具可读性。

+0

谢谢,现在它可以工作。我将使用SSCCE :) – Teodoro