:- package(gui). :- package(guibuilder). main(Applet, _) :- checkboxGroup_create(Group), frame_create(Frame), frame_setTitle(Frame, 'Frame Test'), gui(Frame, gridbag, [ fill=both, weightx=0.0, weighty=0.0, panel(_, grid(2,2), [ checkbox(_, 'Check 1', Group, false), checkbox(_, 'Check 2', Group, true), checkbox(_, 'Check 3', Group, false), checkbox(_, 'Check 4', Group, false) ]), weightx=1.0, width=remainder, label(_, 'Label 1'), width=relative, button(_, 'Button 6'), width=remainder, weightx=1.0, choice(_, ['Choice 1', 'Choice 2', 'Choice 3']), width=1, height=3, weighty=1.0, text_area(_, 4, 10), width=remainder, height=1, weighty=0.0, text_field(_), list(_, 3, true, ['List 1', 'List 2', 'List 3', 'List 4']), button(_, 'Button 10') ** action(component_setVisible(Frame, false)) ]), /*** menubar(Frame, [ menu(_, 'Examples', [ item(_, 'Basic'), item(_, 'Simple'), separator, menu(_, 'More Examples', [ item(_, 'One'), item(_, 'Two') ]), item(_, 'Exit') ** action(halt) ])]), ***/ component_setSize(Frame, 400, 300), gui(Applet, border, [ 'North' / panel(_, grid(1, 2), [ button(_, 'Push me') ** action(component_setVisible(Frame,true)), button(_, 'Exit') ** action(halt) ]), 'Center' / text_area(Messages), 'South' / canvas(_, paint(_), 200, 200, false) ]), textArea_getOutputStream(Messages, Stream), set_output(Stream). paint(Area) :- color_getColor(red, Red), graphics_setColor(Area, Red), graphics_fillRect(Area, 10, 10, 300, 20), color_getColor(green, Green), graphics_setColor(Area, Green), graphics_fillOval(Area, 40, 50, 70, 30).