Re: Re: Two Notebooks Open at the Same Time
- To: mathgroup at smc.vnet.net
- Subject: [mg97662] Re: [mg97638] Re: Two Notebooks Open at the Same Time
- From: Fred Simons <f.h.simons at tue.nl>
- Date: Wed, 18 Mar 2009 04:53:39 -0500 (EST)
- References: <20168557.1237028125335.JavaMail.root@m02> <200903142318.SAA25410@smc.vnet.net> <200903171002.FAA17247@smc.vnet.net>
By using DialogInput the assignment can be done in the main notebook:
ret=DialogInput[{TextCell["Enter a name: "],
InputField[Dynamic[nm],String],
DefaultButton[DialogReturn[nm]]}]
Or you can pass the proper context to the dialog notebook:
CreateDialog[{TextCell["Enter a name: "],
InputField[Dynamic[nm],String],
DefaultButton[DialogReturn[ret=nm]]},
CellContext->Context[]]
Fred Simons
Eindhoven University of Technology
Januk wrote:
> One needs to be careful using the "Unique to This Notebook" context
> setting. It causes some strange behaviour when using dialog boxes.
> The following example from the CreateDialog help page (ref/
> CreateDialog) does not work as described when using the "Unique to
> This Notebook" setting. Note that the example does work as expected
> when running the notebook in the Global` context:
>
> In[1] := CreateDialog[{TextCell["Enter a name: "],
> InputField[Dynamic[nm], String],
> DefaultButton[DialogReturn[ret = nm]]}];
> In[2] := ret
>
> Out[2] = ret
>
> There appears to be a context issue, though running Context[] does not
> reveal what the issue is:
>
> In[3] := Context[]
> In[4] := CreateDialog[{Context[]}];
> Out[3] = "Notebook$$13`"
>
> This behaviour appears in version 6 and 7.0 for Microsoft Windows (32-
> bit).
>
> Januk
>
>
> On Mar 15, 6:28 am, Brett Champion <bre... at wolfram.com> wrote:
>
>> [I'm NOT an expert on this stuff, but...]
>>
>> "Evaluation" > "Notebook's Default Context" is probably useful,
>> especially the "Unique to This Notebook" setting.
>>
>> Brett Champion
>>
>
>
>
- References:
- Re: Two Notebooks Open at the Same Time
- From: "David Park" <djmpark@comcast.net>
- Re: Two Notebooks Open at the Same Time
- From: Januk <ggroup@sarj.ca>
- Re: Two Notebooks Open at the Same Time