Recent

Author Topic: Receive mouse events for an external UI program launched by TAsyncProcess  (Read 1838 times)

FangQ

  • Full Member
  • ***
  • Posts: 134
I am trying to call "octave --no-gui --interative" with TAsyncProcess, send a command to make a 3D plot, then I want to user to rotate/zoom in the octave plot window.

I was able to achieve most of the above, except the last step, i.e. moving mouse to rotate the plot in the octave figure window. it looks like the octave thread is suspended or some sort, the figure window can not refresh or receive any mouse events.

if I launch octave using --force-gui, I can use mouse to interact with the GUI window of octave.

I am wondering if this is an octave issue, or TAsyncProcess issue?

if it is the latter, if I want to interact with a process, should I create the process inside a separate thread?

thank you

FangQ

  • Full Member
  • ***
  • Posts: 134
interesting. I just tried

Code: Pascal  [Select][+][-]
  1. cmd:='inputdlg(''test'')'+#10;  

I can indeed interact with the window popped up. But if I do

Code: Pascal  [Select][+][-]
  1. cmd:='mesh(peaks)'+#10;

I see a plot initially, but the window is frozen, can not receive events or even being closed. the console output shows "XOpenIM() failed".

If I start octave inside a real terminal, mesh(peaks) works without any problem, even the "XOpenIM() failed" warning is also shown.
« Last Edit: July 24, 2017, 07:07:44 am by FangQ »

FangQ

  • Full Member
  • ***
  • Posts: 134
never mind, I upgraded octave from 3.8 to 4.0.2, the plot window now receive interactions properly. so, it looks like the issue was due to octave instead of lazarus.

 

TinyPortal © 2005-2018