6
$\begingroup$

I first thought that doing Quit[] in a cell, or Evaluation->Quit kernel, is supposed to remove all Global variables, but I have a case where this is not happening, then I read that there is a command Quit from the menu to also shut down the front end, so I wanted to try that to see if that will clear those variables, which I suppose are saved by the front end. (I know I can ofcourse just type Remove["Globals`*"], but was looking looking at what seems like a symbols leakage problem with Manipulate.

Any one knows how to close the front end please?

I can't find this Quit command from the menu, which is supposed to be different from the Quit[] for the kernel? I only see Quit kernel in the menu. But when I try that, these variables are not cleared!

enter image description here

Again, the reason I wanted to do the above is because not all variables are cleared when I restart the kernel (either by Quit[] or by stopping the kernel from the menu:

enter image description here

Btw, according to this answer here Quit[] the kernel is supposed to clear all variables ! but this is not the case with me here. ps. I never even knew before there was a Quit command for the front end.

ps. I will be happy to post the code that generates this if needed.

thanks

edit(1)

According to help message above, it said there is Quit menu item to close the from end, but on windows, V 8.04, I only see Quit kernel, which is the same as Quit[] typed in the notebook.

enter image description here

$\endgroup$
1

2 Answers 2

12
$\begingroup$

From your description you seem to have an open window containing Dynamic content, which is what prevents some variables being cleared by simply quitting the kernel (or rather they get redefined again).

So why don't you just close all windows containing any Manipulates or Dynamic and then use Quit[] (or Quit Kernel from the Evaluation menu) ?

The only menu command to quit the Front End is the "Quit Mathematica" menu item in the Mathematica menu, which will indeed work (in a rather radical way) until you reopen the same notebooks that caused the problem to start with.

$\endgroup$
2
  • 1
    $\begingroup$ No @NasserM.Abbasi. Andrzej means that you should close the window(s) containing the actual Manipulate, since those are the source of your problem. Then you just use Quit[] in a (newly) open window $\endgroup$
    – magma
    Jan 25, 2012 at 10:48
  • $\begingroup$ It might look pedantic, but I feel you really want to understand this: I think the important remark of Andrzej ia that the restart of the Kernel of course always removes the global symbols - it's the Manipulate/Dynamic which recreates them during it's initialization. $\endgroup$ Jan 25, 2012 at 15:42
9
$\begingroup$

I cannot reproduce your problem, but the command to close a front end is FrontEndTokenExecute["Close"]. If you want to terminate the complete front end process (including all running notebooks), you use FrontEndTokenExecute["FrontEndQuit"]. There's also a middle-ground which closes all notebooks, but doesn't terminate the process: FrontEndTokenExecute["CloseAll"].

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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