Hello Prolog community,
I am struggling with my first XPCE GUI and I was wondering if anyone could help me.
I’m using: SWI-Prolog version 8.4.3.
I want to code an editable matrix, with the first two rows and the first column being help lables and the rest being textboxes that are used like excel-cells.
Here is a quick figure of how it is looking at the moment, and how it is supposed to look like:
My code looks like this:
t1:-new(D,dialog('My first GUI')),
send(D, append, label(lab_0_0,'Caption')),
send(D, append, label(lab_1_0,'lab_1_0')),
send(D, append, label(lab_1_1,'lab_1_1'), right),
send(D, append, label(lab_1_2,'lab_1_2'), right),
send(D, append, label(lab_1_3,'lab_1_3'), right),
send(D, append, label(lab_1_4,'lab_1_4'), right),
send(D, append, label(lab_1_5,'lab_1_5'), right),
send(D, append, label(lab_2_0,'lab_2_0'), next_row),
send(D, append, label(lab_2_1,'lab_2_1'), right),
send(D, append, label(lab_2_2,'lab_2_2'), right),
send(D, append, label(lab_2_3,'lab_2_3'), right),
send(D, append, label(lab_2_4,'lab_2_4'), right),
send(D, append, label(lab_2_5,'lab_2_5'), right),
send(D, append, label(lab_3_0,'lab_3_0'), below),
send(D, append, text_item('', 'text3_1',
message(D?generate_member, execute)),right),
send(D, append, text_item('', 'text3_2',
message(D?generate_member, execute)),right),
send(D, append, text_item('', 'text3_3',
message(D?generate_member, execute)),right),
send(D, append, text_item('', 'text3_4',
message(D?generate_member, execute)),right),
send(D, append, text_item('', 'text3_5',
message(D?generate_member, execute)),right),
send(D,open).
The behavior I would like to change, in words:
- The elements placed with the keyword “below” are not inserted in the left-most column 0, but inserted in the right-most column that exists until then. Is it possible to insert “below-left” or “below element xy”?
- The textboxes each appear with a “:” to their left, even though their string is empty. Is there a way to turn that off?
- The auto-spacing makes the textboxes really long sometimes, depending on resolution, amount of monitors, etc. This dynamic spacing is good, but is it possible to fix the elements’ size?
- The selected text box has a red triangle attached, to indicate the cursor. Is there a way to change the style/color of that symbol, to black for instance?
Best regards and many thanks in advance,
Malo