Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2020-05

Not restored Screen.ActiveForm after InputQuery

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Alexey Tor.

CudaText for Linux gtk2 x64.
its Python API fails when it reads current form, after plugin shows InputQuery dialog.
I added test ShowMessage near the showing InputQuery and found that after InputQ call, program reads empty Screen.ActiveForm. marked by comment.
is it LCL bug?
LCL must restore ActiveForm after InputQuery.
IDE r63175.

function Py_dlg_input(Self, Args : PPyObject): PPyObject; cdecl;
var
   P1, P2: PChar;
   StrCaption, StrVal: string;
   t: string;
begin
   with AppPython.Engine do
     if Bool(PyArg_ParseTuple(Args, 'ss:dlg_input', @P1, @P2)) then
     begin
       StrCaption:= string(P1);
       StrVal:= string(P2);
       t:= screen.ActiveForm.caption;////this works
       if InputQuery(msgTitle, StrCaption, StrVal) then
         Result:= PyString_FromString(PChar(StrVal))
       else
         Result:= ReturnNone;
       t+= ', '+screen.ActiveForm.caption; //this crashes
       showmessage(t);
     end
   else
     Result:= ReturnNone;
end;

Alexey Torgashin

Reply by email