MathGroup Archive 2009

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Problem using a dialog and dynamic

  • To: mathgroup at smc.vnet.net
  • Subject: [mg97847] Re: Problem using a dialog and dynamic
  • From: Albert Retey <awnl at gmx-topmail.de>
  • Date: Tue, 24 Mar 2009 05:27:35 -0500 (EST)
  • References: <gq54sh$7s5$1@smc.vnet.net>

Hi,

> The following code should show a button and a text field. When I click the
> button, i should get a system dialog allowing me to select a folder, and the
> folder's file and pathname should then be displayed in the text field.
> 
>  
> 
> Panel[Grid[{{Button["Select/Change Project
> Directory",sourcedir=SystemDialogInput["Directory","C:\\"]]},{Column[{"Curre
> nt Project Directory:",InputField[Dynamic[sourcedir],String]}]}}]]
> 
>  
> 
> Unfortunately, the performance is erratic!
> 
>  
> 
> If I click the button, then select a folder of the C drive, say C:\first,
> and click "open", the textfield display C:\first as expected. But if I then
> click the button again, and select, say, folder off the C:\first\second and
> click "open", the textfield does not change, nor does it for any subsequent
> clicks. However, if I select the desktop, it works as expected, and if I
> select the C: drive again it also works.
> 
>  
> 
> To summarise, if i want to change the folder selection, I have to select the
> C: drive once, then click again and select the subfolder I want, and if I
> want to change the subfolder, I have to select the c: drive again, before I
> can select the new subfolder.
> 
>  
> 
> Is this a bug, or am I doing something stupid? I am using V7 on Windows
> Vista Home Premium.

you will need to use:

Method -> "Queued"

for the button. Otherwise whenever it takes you too long to select
something, the button action will timeout and the assignement to
sourcedir will never happen. For the default method "Preemptive" there
is a timeout for the button action of about 5 seconds.

hth,

albert


  • Prev by Date: Kernel is quitting on me
  • Next by Date: Re: Wavelet Denoising using Wavelet Explorer package
  • Previous by thread: Re: Problem using a dialog and dynamic
  • Next by thread: Got a tip ?