Open Uefi1 opened 6 months ago
I actually understood something: the console application does not intercept WM_USER and other messages that's why the event doesn't fire !!!!!
I came to this conclusion after looking at how Vcl.PythonGUIInputOutput is implemented; in general, this entire Python4Delphi library is terribly and incomprehensibly written
No, it turned out that this is not even the case: the console application does not accept messages; everything has been transferred to the form; the display also does not work! Generally a bug !
Doesn't work in any way and under no circumstances:
procedure TForm2.PythonInputOutputSendUniData(Sender: TObject;
const Data: string);
begin
//PythonInputOutput.DisplayString(Data);
cs.Enter;
Memo1.Lines.Add('WORK'); //NOT (
cs.Leave;
end;
procedure TForm2.InitPython;
begin
PythonEngine := TPythonEngine.Create(nil);
try
PythonInputOutput:=TPythonGUIInputOutput.Create(nil);
PythonInputOutput.OnSendUniData:=PythonInputOutputSendUniData;
PythonEngine.IO:=PythonInputOutput;
PythonInputOutput.UnicodeIO:=True;
PythonInputOutput.RawOutput := False;
PythonInputOutput.DelayWrites:=True;
PythonEngine.InitThreads := True;
PythonEngine.UseLastKnownVersion := False;
PythonEngine.DllPath := ExtractFilePath(ParamStr(0));
PythonEngine.DllName := 'python310.dll';
PythonEngine.AutoLoad := False;
PythonEngine.AutoUnload := False;
PythonEngine.AutoFinalize := True;
PythonEngine.RedirectIO := True;
PythonEngine.LoadDll;
TPythonThread.Py_Begin_Allow_Threads;
finally
//
end;
end;
Hello, the OnSendUniData event assigned to TPythonGUIInputOutput is not WORK.