Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

I'd like to show the output of this program into one large Panel, but when I surround this code with Panel[ ], it doesn't seem to work. Why is that?

listA = {};
listB = {};
"Verzameling A : " InputField[Dynamic[Null, AppendTo[listA, #] &]] 

"Verzameling B : " InputField[Dynamic[Null, AppendTo[listB, #] &]]


listAShow := Sort[ DeleteDuplicates[listA]];
listBShow := Sort[ DeleteDuplicates[listB]];

"Verzameling A =" Dynamic[listAShow]
"Verzameling B =" Dynamic[listBShow]

unie := Union[listAShow, listBShow];
doorsnede := Intersection[listAShow, listBShow];

toonOpl = False;
Row@{Checkbox[Dynamic[toonOpl]], "Toon bewerkingen"}
Dynamic[If[toonOpl,
  Column@{
    Row@{"Unie van A en B = ", unie}
    , Row@{"Doorsnede van A en B = ", doorsnede}
    }, {}]]

Button["Reset alles", listA = {}; listB = {}]

Thanks all!

share|improve this question
    
@Kuba Hehe... took me some time to understand, how you heard him singing in the post ;-) –  halirutan Sep 5 '13 at 15:33
    
@halirutan fortunatelly I've corrected that typo before ruebenko commented it :) –  Kuba Sep 5 '13 at 15:46
    
Thanks for the comment! Post formatted... All help appreciated on the panel! –  Gabriel Sep 5 '13 at 15:50

1 Answer 1

up vote 1 down vote accepted

Just put all the code lines which display output into a Column:

listA = {};
listB = {};
listAShow := Sort[DeleteDuplicates[listA]];
listBShow := Sort[DeleteDuplicates[listB]];
unie := Union[listAShow, listBShow];
doorsnede := Intersection[listAShow, listBShow];
toonOpl = False;

Panel@Column@{
   "Verzameling A : " InputField[Dynamic[Null, AppendTo[listA, #] &]],
   "Verzameling B : " InputField[Dynamic[Null, AppendTo[listB, #] &]],
   "Verzameling A =" Dynamic[listAShow], 
   "Verzameling B =" Dynamic[listBShow], 
   Row@{Checkbox[Dynamic[toonOpl]], "Toon bewerkingen"}, 
   Dynamic[If[toonOpl, 
     Column@{Row@{"Unie van A en B = ", unie}, 
       Row@{"Doorsnede van A en B = ", doorsnede}}, {}]], 
   Button["Reset alles", listA = {}; listB = {}]}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.