0

I am working on my first prolog - GUI with XPCE consisting of 10 columns of text items.

However, not all elements of the GUI can be seen: The right two columns are cut off!

GUI is cut off at the right side

I tried adjusting the dialog size, but the size of the dialog does not change. I tried changing the size of the text items, but XPCE seems to reserve the same amount of space for each column regardless of the text item width.

Below is my code:

:- use_module(library(pce)).



t1:-new(D,dialog('GUI', size(200, 200))),
new(H1, dialog_group('  Caption1  ')),

    
new(HN1, text_item('cn1','')),
send(HN1, width,40),
send(HN1,show_label,false),
send(H1, append, HN1,right),

send(D, append, H1),


new(H2, dialog_group(' Caption2 ')),


column(C1,0,group,"Cpt1",'test1'),

column(C2,1,group,"Cpt2",'test2'),
column(C3,1,group,"Cpt3",'test3'),
column(C4,1,group,"Cpt4",'test4'),
column(C5,1,group,"Cpt5",'test5'),
column(C6,1,group,"Cpt6",'test6'),
column(C7,1,group,"Cpt7",'test7'),
column(C8,1,group,"Cpt8",'test8'),
column(C9,1,group,"Cpt9",'test9'),
column(C10,1,group,"Cpt10",'test10'),


row(RowAll,group,C1,C2,C3,C4,C5,C6,C7,C8,C9,C10),
send(H2,append,RowAll),

send(D, append, H2, below),


send(D,open).

column(C,0,Type,Labeltext1,Labeltext2) :-
    new(C,dialog_group('Col1',Type)),
    
    new(Lab1,label(lab_1_0,Labeltext1)),
    %send(Lab1,alignment,right),
    %get(Lab1,alignment,right),
    send(C, append, Lab1),
    %send(lab_1_0, alignment, right),
    send(C, append, label(lab_1_1,Labeltext2), below),
    
    
    send(C,gap,size(1,0)),
    
    new(CN1, text_item('cn1','')),
    send(CN1, width,20),
    send(CN1,show_label,false),
    send(C, append, CN1,below),

    new(CN2, text_item('cn2','')),
    send(CN2, width,20),
    send(CN2,show_label,false),
    send(C, append, CN2,below),

    new(CN3, text_item('cn3','')),
    send(CN3, width,20),
    send(CN3,show_label,false),
    send(C, append, CN3,below),

    new(CN4, text_item('cn4','')),
    send(CN4, width,20),
    send(CN4,show_label,false),
    send(C, append, CN4,below),
    
    new(CN5, text_item('cn4','')),
    send(CN5, width,20),
    send(CN5,show_label,false),
    send(C, append, CN5,below),
    
    new(CN6, text_item('cn4','')),
    send(CN6, width,20),
    send(CN6,show_label,false),
    send(C, append, CN6,below).


column(C,1,Type,Labeltext1,Labeltext2) :-
    new(C,dialog_group('Col1',Type)),
    
    send(C,gap,size(1,0)),
    
    new(Lab1,label(lab_1_0,Labeltext1)),
    send(C, append, Lab1),

    send(C, append, label(lab_1_1,Labeltext2), below),
    
    
    new(CN1, text_item('cn1','')),
    send(CN1, width,10),
    send(CN1,show_label,false),
    send(C, append, CN1,below),

    new(CN2, text_item('cn2','')),
    send(CN2, width,10),
    send(CN2,show_label,false),
    send(C, append, CN2,below),

    new(CN3, text_item('cn3','')),
    send(CN3, width,10),
    send(CN3,show_label,false),
    send(C, append, CN3,below),

    new(CN4, text_item('cn4','')),
    send(CN4, width,10),
    send(CN4,show_label,false),
    send(C, append, CN4,below),
    
    new(CN5, text_item('cn4','')),
    send(CN5, width,10),
    send(CN5,show_label,false),
    send(C, append, CN5,below),
    
    new(CN6, text_item('cn4','')),
    send(CN6, width,10),
    send(CN6,show_label,false),
    send(C, append, CN6,below).

row(R,Type,Column1,Column2,Column3,Column4,Column5,Column6,Column7,Column8,Column9,Column10) :-
    new(R,dialog_group('ColAll',Type)),
    
    %send(R,gap,size(1,1)),
    send(R, append, Column1, right),
    send(R, append, Column2, right),
    send(R, append, Column3, right),
    send(R, append, Column4, right),
    send(R, append, Column5, right),
    send(R, append, Column6, right),
    send(R, append, Column7, right),
    send(R, append, Column8, right),
    send(R, append, Column9, right),
    send(R, append, Column10, right).

Can anyone help me: How may I make everything fit to the screen? Alternatively is there a way to have a horizontal scroll bar for the cases where not everything fits to the screen?

I hope, someone can help me with this! :)

Best regards, Malo

Paulo Moura
  • 18,373
  • 3
  • 23
  • 33
Dinhosaur
  • 11
  • 2

0 Answers0