2
$\begingroup$

I think I have hit on a true bug in the Mathematica Front End:

If I define

plotFunc[] := Print[GraphicsGrid[{{Plot[x^2, {x, 0, 1}], Plot[x^3, {x, 0, 1}]}}]];

I can execute the function:

plotFunc[]

and get as expected

simple plot example

If I now define

CreateDialog[{Button["Plot", plotFunc[]]}];

I get a little dialog

button

But if I press the button, the red 'Messages' window pops up with a the message:

enter image description here

The first line, with a red rectangle shows the error message "An invalid typeset structure was generated: Missing BoxData."

The problem only occurs, when two graphics are assembled, i.e. if there is a simple, single Plot[] call only in the plotFunc[], things work correctly.

Any ideas?

Thank you!

$\endgroup$
4
  • $\begingroup$ Are you sure that this is what CreateDialog is supposed to do? When I execute CreateDialog[{Button["Plot", p1 = Plot[x^2, {x, 0, 1}]]}];, it brings up a dialog box. When I hit the Plot button, nothing seems to happen. But when I execute p1 in the current notebook, it then displays the plot. I'm not sure that CreateDialog is mean to do things in the Front End. However, when I run your code, I don't get the error messages you are, but the plots are printed to the error message window that appears, which is weird. $\endgroup$
    – march
    Commented Apr 10 at 16:53
  • $\begingroup$ Yes, the correct behaviour is that the plots appear in the error message window. This is where the output should go. - But the fact that it creates an error there is the issue. $\endgroup$ Commented Apr 10 at 19:03
  • $\begingroup$ Answer from technical support: "I have forwarded an issue report to our developers with the information you provided." $\endgroup$ Commented Jul 5 at 7:04
  • $\begingroup$ I've added the bugs tag, since your message from technical support seems to indicate that it really is a bug. $\endgroup$
    – march
    Commented Jul 5 at 15:26

0

Browse other questions tagged or ask your own question.