Re: IDL 7: Window blanks while waiting for input from the workbench [message #75011] |
Mon, 14 February 2011 13:54  |
James[2]
Messages: 44 Registered: November 2009
|
Member |
|
|
On Feb 14, 12:38 pm, Jared Espley <jesp...@gmail.com> wrote:
> My apologies if this is known problem with a known solution but some
> searching didn't turn up anything.
>
> When using the IDL workbench in 7.0 or 7.1 on Windows XP, I have the
> following problem. My code enters in a repeat-while loop and within
> that loop plots something and then gives a command line prompt back to
> the user. The plot turns out fine but as soon as I click on something
> else besides the plot window (e.g. the workbench window), the plot
> turns blank. When I quit the code, then the plot window has its data
> restored. I've toyed with the retain keyword in plot but this did not
> solve the problem.
>
> Here is some code to reproduce the problem:
>
> input=''
>
> repeat begin
>
> read, input, prompt='Enter something'
>
> plot, [1,0], [0,1]
>
> endrep until input EQ 'quit'
>
> end
>
> Thanks,
> Jared
I ran this code from the Workbench command line in IDL 8.0 on Windows
XP-64. If the Workbench is maximized, I cannot even click on the plot
window in the taskbar to bring it forward and look at the plot. It
becomes usable after I type 'quit'. However, if I make the Workbench
smaller so I can see the Direct Graphics window behind it, the plots
work fine and do not go blank when I click inside the Workbench.
|
|
|
Re: IDL 7: Window blanks while waiting for input from the workbench [message #75172 is a reply to message #75011] |
Fri, 18 February 2011 08:59  |
Jared Espley
Messages: 17 Registered: February 2006
|
Junior Member |
|
|
For any future readers that find this thread, here is the response I
got from ITT:
Hello Jared,
This problem can occur when using the READ procedure within a loop.
However, there is a workaround which will allow you to plot like
this. If you instead create an IDL_IDLBridge object, which is a
separate child IDL process, in which to perform the plot operations,
the loop will correctly continue to refresh the window because it
exists in a separate process space. For example try the following:
input=''
br = obj_new('IDL_IDLBridge')
br->execute, 'window'
br->execute, 'i=0'
repeat begin
read, input, prompt='Enter something'
br->execute, 'plot, sin(2*!pi*findgen(100)/99 + i) & i++'
endrep until input eq 'quit'
end
This should allow you to plot in the way that you want. Check out the
documentation on IDL_IDLBridge for more information. You can send and
receive data to/from the bridge object as well, allowing you to update
the plot as needed.
Sincerely,
Josh Elliott
Technical Support Engineer
On Feb 14, 4:54 pm, James <donje...@gmail.com> wrote:
> On Feb 14, 12:38 pm, Jared Espley <jesp...@gmail.com> wrote:
>
>
>
>> My apologies if this is known problem with a known solution but some
>> searching didn't turn up anything.
>
>> When using the IDL workbench in 7.0 or 7.1 on Windows XP, I have the
>> following problem. My code enters in a repeat-while loop and within
>> that loop plots something and then gives a command line prompt back to
>> the user. The plot turns out fine but as soon as I click on something
>> else besides the plot window (e.g. the workbench window), the plot
>> turns blank. When I quit the code, then the plot window has its data
>> restored. I've toyed with the retain keyword in plot but this did not
>> solve the problem.
>
>> Here is some code to reproduce the problem:
>
>> input=''
>
>> repeat begin
>
>> read, input, prompt='Enter something'
>
>> plot, [1,0], [0,1]
>
>> endrep until input EQ 'quit'
>
>> end
>
>> Thanks,
>> Jared
>
> I ran this code from the Workbench command line in IDL 8.0 on Windows
> XP-64. If the Workbench is maximized, I cannot even click on the plot
> window in the taskbar to bring it forward and look at the plot. It
> becomes usable after I type 'quit'. However, if I make the Workbench
> smaller so I can see the Direct Graphics window behind it, the plots
> work fine and do not go blank when I click inside the Workbench.
|
|
|