#!/home/paul/bin/kaptain -V

start :framed "mpage Mini-Dialog" -> file numpages margins buttons;

file "File to print" -> @infile("*.txt");

numpages :horizontal "Number of pages on each page" -> p1 | ! p2 | p4 | p8;
  p1 "1 pg" -> "1";
  p2 "2 pgs" -> "2";
  p4 "4 pgs" -> "4";
  p8 "8 pgs" -> "8";

margins :horizontal "Margins" -> left right top bottom;
  left "Left" -> @integer(10,100)=40;
  right "Right" -> @integer(10,100)=50;
  top "Top" -> @integer(10,100)=20;
  bottom "Bottom" -> @integer(10,100)=30;

buttons :horizontal -> echo print dismiss;
  echo -> @echo(cmd)="Echo";
  print -> @action(cmd)="Print";
  dismiss -> @close()="Dismiss";

cmd -> "mpage -P -"numpages" -m"left"l"bottom"b"top"t"right"r "file;
#cmd -> "mpage -"numpages" -m"left"l"bottom"b"top"t"right"r "file">test.ps";